Syntax Highlighting SwiftUI Code with Swift Syntax

I recently updated DetailsPro to include syntax highlighting in the "Copy Code" section. This was a long-standing request I've had since I first released DetailsPro, which I kept putting off because I thought it was going to be too complex to implement.

Turns out... it's not! So I thought I'd write up a post about how I used @swiftlang/swift-syntax to natively parse and syntax-highlight the SwiftUI code that DetailsPro generates.

Designers and developers use DetailsPro to create simple designs like the one seen here and often export or copy code straight into Xcode.
Designers and developers use DetailsPro to create simple designs like the one seen here and often export or copy code straight into Xcode.

Users create SwiftUI designs in DetailsPro by arranging and styling SwiftUI views to their liking. At any point, they can copy the SwiftUI code that represents their design. My end goal was to display this code in DetailsPro with the same light and dark color schemes as Xcode. Ideally, I wanted a solution that was native Swift, reliable, and worked instantly. It also has to work on iOS, macOS, and visionOS where the DetailsPro editor runs.

Enter: swift-syntax.

HOW SWIFT-SYNTAX WORKS

The good news is that swift-syntax is quite powerful. The bad news is (also) that swift-syntax is quite powerful. At a high level, this library is able to take Swift code you give it and turn it into an abstract representation that can be traversed and manipulated.

So, we can use it for syntax highlighting by using just two of its many abilities: parsing and traversal.

Swift-syntax will take valid code you give it and very quickly identify what is basically a super-nested tree of where things are. For example, something simple like "import SwiftUI" is identified as an ImportDecl, an strongly-typed identifier built-in to swift-syntax, and then within that strongly typed ImportDecl, you can access the part that says "import" and the part that says "SwiftUI". You can see the text contents, the range numbers, and more.

Just this VStack init has many key ranges that are identified and broken down.
Just this VStack init has many key ranges that are identified and broken down.

There's a great resource made by Kishikawa Katsumi at swift-ast-explorer.com that lets you visualize what is happening. I definitely recommend pasting in your code and using this to understand how swift-syntax identifies any particular range of a given input.

Even with just a short and simple file, you get a long abstract tree representation to look at.
Even with just a short and simple file, you get a long abstract tree representation to look at.

HOW I CUSTOMIZED SWIFT-SYNTAX FOR DETAILSPRO

Swift-syntax lets you create your own "SyntaxVisitor" you can use to go through parsed code and do something whenever you're at some part of code that you care about. For example, you can stop whenever you're at a string, a function, a colon, and other landmarks in Swift code that are nodes in the tree. Every Syntax node has properties you can access like text content, child nodes, and most important to us, the range of this node in the original code string.

To start, I needed a function that would take a string of code as input and output a string with attributes that I could directly display in my UI.

For my use case, I created a SyntaxVisitor that would stop at the kinds of nodes that I cared about. In my case, it was only the types of nodes that appear in simple SwiftUI view declarations. Then, as my visitor encountered one of these nodes, I used the range to add an attribute to my AttributedString.

import SwiftParser import SwiftSyntax import SwiftUI import UIKit struct SwiftParser { static func makeHighlighted(for code: String) -> NSAttributedString { let attributedString = NSMutableAttributedString(string: code) let sourceFile = Parser.parse(source: attributedString.string) let visitor = MyVisitor(attributedString: attributedString) visitor.walk(sourceFile) return attributedString } } class MyVisitor: SyntaxVisitor { let attributedString: NSMutableAttributedString init(attributedString: NSMutableAttributedString) { self.attributedString = attributedString super.init(viewMode: .all) } // Override for the types of nodes you care about override func visit(_ node: LabeledExprSyntax) -> SyntaxVisitorContinueKind { if let trailingComma = node.trailingComma { highlight(syntax: trailingComma, color: .label) } if let colon = node.colon { highlight(syntax: colon, color: .label) } if let label = node.label { highlight(syntax: label, color: .codeOtherTypes) } return .visitChildren } // Override this general function for visiting common smaller pieces of code override func visit(_ token: TokenSyntax) -> SyntaxVisitorContinueKind { if token.leadingTrivia.contains(where: \.isWhitespace) { highlight( startPosition: token.position, endPosition: token.positionAfterSkippingLeadingTrivia, color: .gray) } if token.trailingTrivia.contains(where: \.isWhitespace) { highlight( startPosition: token.endPositionBeforeTrailingTrivia, endPosition: token.endPosition, color: .gray) } switch token.tokenKind { case .binaryOperator(_): highlight(syntax: token, color: .label) case .stringQuote: highlight(syntax: token, color: .codeString) case .stringSegment(_): highlight(syntax: token, color: .codeString) case .integerLiteral(_), .floatLiteral(_): highlight(syntax: token, color: .codeNumbers) case .leftParen, .rightParen, .period: highlight(syntax: token, color: .label) case .leftBrace, .rightBrace, .leftSquare, .rightSquare: highlight(syntax: token, color: .label) default: break } return .skipChildren } // I created multiple highlight functions to act as convenience methods private func highlight(syntax: SyntaxProtocol, color: UIColor) { highlight( startPosition: syntax.positionAfterSkippingLeadingTrivia, endPosition: syntax.endPositionBeforeTrailingTrivia, color: color) } private func highlight( startPosition: AbsolutePosition, endPosition: AbsolutePosition, color: UIColor ) { let code = attributedString.string let tokenStart = code.utf8.index( code.utf8.startIndex, offsetBy: startPosition.utf8Offset) let tokenEnd = code.utf8.index( code.utf8.startIndex, offsetBy: endPosition.utf8Offset) let tokenRange: Range<String.Index> = tokenStart..<tokenEnd let nsRange = NSRange(tokenRange, in: code) highlight(color: color, range: nsRange) } // This is the main highlight method that does the highlighting private func highlight(color: UIColor, range: NSRange) { let font = UIFont.monospacedSystemFont(ofSize: 12, weight: .regular) let paragraphStyle = NSMutableParagraphStyle() paragraphStyle.lineSpacing = 6 paragraphStyle.lineBreakMode = .byCharWrapping attributedString.addAttributes( [ .font: font, .foregroundColor: color, .paragraphStyle: paragraphStyle, ], range: range) } }

Tips I Wish I Knew

First, you'll encounter a concept in called "trivia" which is the name swift-syntax gives whitespaces, newlines, tabs, and comments. It took me a while to figure out that through trivia is how you can highlight something like a line comment. And, I needed to make sure I was formatting the invisible whitespace between nodes so that my code still displayed proper spacing.

Second, the SyntaxVisitor functions expect a return value like the .skipChildren or .visitChildren values you see above. It took me a while to figure out exactly what was going on here, and basically what you're doing is telling the visitor whether or not it needs to go deeper after whatever you've identified. For example, if you've already identified an "import SwiftUI" statement and highlighted the appropriate parts, there's likely nothing more in there. With other higher-level nodes you'll visit, you'll likely want to keep visiting any nested child nodes that may exist.

The End Results

DetailsPro now shows live-updating, syntax-highlighted SwiftUI code when users select any part of their design.
DetailsPro now shows live-updating, syntax-highlighted SwiftUI code when users select any part of their design.

Today, syntax highlighting is running great in DetailsPro and I'm happy to have added a what is surely a reliable dependency that will enjoy continued support by the Swift community.

I was on Tim Chaten's wonderful podcast this past week. We chatted about the visionOS version of DetailsPro and what went into making it. Thanks again, Tim, for having me on.

Things I'm Excited for on Apple Vision Pro

  1. Watching a movie with AirPods Max on from bed
  2. Opening up emails in a huge mail window in my living room
  3. Catching an NBA game courtside (surely, this will be offered)
  4. Enjoying focusing on some work in the immersive Environments
  5. Making DetailsPro work well to design visionOS apps quickly

Frustration Using Apple News+

Apple News+ magazines on a 12.9-inch iPad Pro should look and feel amazing, but sadly that’s not the case today. In this post I’ll show what is frustrating about the experience and how things could be improved.

Magazine Covers

Here's a current A-list magazine and my iPad side-by-side. We can see they're similar enough in size:

Vogue December 2023 on the left, my 12.9-inch iPad Pro on the right.
Vogue December 2023 on the left, my 12.9-inch iPad Pro on the right.

Now here’s what it looks like when you open this magazine on the iPad:

The cover is cut off on the iPad.
The cover is cut off on the iPad.

The frustration begins and the reading experience is interrupted as soon as you notice you’re not able to see the whole cover without scrolling.

The cover photo is not fully shown and lines of text are unreadable.
The cover photo is not fully shown and lines of text are unreadable.

The frustration continues a few seconds after starting to read the cover: it’s not sharp and in Retina-resolution, but blurry and noticeably pixelated. You’d be forgiven for thinking we're waiting for a progressive JPEG to load, but this is it.

A screenshot from my iPad at Actual Size in Preview. Go ahead and check out the image up close to see for yourself.
A screenshot from my iPad at Actual Size in Preview. Go ahead and check out the image up close to see for yourself.

You see this with all sorts of other top magazines on the 12.9-inch iPad. Here are screenshots of blurry covers from Wired , The Atlantic , Sports Illustrated , and The New Yorker .

This is strange to me. How could this be? What part of the pipeline could be limiting the magazine covers from looking sharp?

The Fix

The covers should be sharp, Retina-resolution images. They would be a lot more fun to view too if they were "fit" instead of "filled" on the screen. Here's a quick mockup of how that could look:

It would be great to be able to see the whole cover without scrolling, no matter how the iPad and magazine ratios differ.
It would be great to be able to see the whole cover without scrolling, no matter how the iPad and magazine ratios differ.

Tables of Contents

Here's the table of contents from that same issue of Vogue:

It's not that creative, but we do get a big photo from one of the big features and teaser summaries for the smaller stories.
It's not that creative, but we do get a big photo from one of the big features and teaser summaries for the smaller stories.

Now here's what it looks like when you open the table of contents on the iPad:

The text-only treatment makes the table of contents not only drab but exhausting to use.
The text-only treatment makes the table of contents not only drab but exhausting to use.

Again the reading experience is hindered by this design decision to make exploring magazines devoid of any of the visual richness of, well, magazines.

On a print magazine, you can flip through with your fingers and get a quick sense of the photographs within. On the iPad, you have to tap in and out of the table of contents going only off of these text titles that all look the same.

The Fix

The table of contents should be visually rich and hint at the photographs within. There could be interactivity here too, perhaps allowing you to preview a story without opening it, see estimated reading times, or save a story for later directly from the table of contents.

Here's a quick mockup of how it could look simply to add thumbnails to the existing design with no other changes:

Simple thumbnails of lead images would go a long way.
Simple thumbnails of lead images would go a long way.

Thanks for Reading

I love Apple, I love magazines, I love the HI design teams at Apple... I love all of it. That's why I'm writing this post. All I want is for these things to be improved.

I admire the people who worked on this to get it this far. I know it must be difficult to be innovating in the magazine industry, where there have been nothing but headwinds for who knows how long. It's amazing to have this breadth of choice, rolled into Apple One, at my fingertips.

But, that doesn't mean that what this app offers today isn't frustrating. I'm someone who wants to use Apple News+, who wants to tell my friends about it, share stories, and keep paying for it for the foreseeable future. And yet, I can't because many small frustrations add up to an experience that I don't look forward to repeating.

I'll be waiting patiently for that silent update someday when Apple News+ suddenly gets a whole lot better, and rooting for them all the way.

New Version of DetailsPro Coming Soon

I'm currently working on the next version of DetailsPro which is going to be a major update and I'm planning on having it out in the fall. There haven't been any minor updates to DetailsPro over the last couple of months because I've been taking some time off.

I can also tell you right now that your subscription or one-time purchase will still be good. I don't anticipate anything changing there.

DetailsPro will still be DetailsPro, but we're going to be moving into new territory with... prototyping. Can't wait to share more with you soon. 🎉

UIDW 49: A look at watchOS 10

In many ways, designing for the Apple Watch can feel easier: the screen is smaller, its always in Dark Mode, there are fewer controls to choose from...

Yet, to me, to design for the Apple Watch (or to design watchOS itself as our friends at Apple do) is to join a design practice steeped in challenge. Everywhere the iPhone can show you the largest form of an element, like a Navigation Bar, the Watch must do it many times smaller. Everywhere the iPhone can show you beautiful content, the Watch must do it by showing you less.

Thinking about how much effort has gone into figuring out the design of watchOS, I'm reminded of those streets, ones you may have in your own neighborhood, where there is a sign that says "NOT A THROUGH STREET" or "DEAD END" at the entrance. It's true, you can't always know whether a street is a through street by looking at its entrance, but for some funny reason I feel like there should be a way for us to know—like we shouldn't need a sign for it.

People who use our designs feel this way turned up to a hundred. They can't know where tapping a button will take them, whether they'll go to a dead end or to another intersection of paths. The Apple Watch is taking on this challenge, making apps easy to navigate so that people don't end up getting stuck, and it's doing it all on a tiny screen. It's incredible to me and a huge triumph of design.

This week, we're taking a look at the wonderful new strides in Apple Watch design that Apple debuted at WWDC23. I hope you find something here that you can mix into your own design work. Thank you for reading UI Designer Weekly. —S


Works on Every Face

The new Smart Stack on watchOS 10 lets you turn the Digital Crown on any watch face to reveal widgets. Before watchOS 10, you'd have to select a certain watch face if you wanted room for a large widget. Now, you can use any watch face you like and have quick access to gorgeous full-color widgets. This is a great example of improving on a design to lift restrictions that people might have wondered about and never fully understood.


Take It Corner-to-Corner

A new design language in watchOS 10 emphasizes the corners of the Watch's display, recommending new styles that include corner buttons like this view of Weather. Many apps in the watchOS section of the Keynote and on the new watchOS 10 web page take advantage of this new style to enable faster switching between sections and simpler navigation back from detail pages.


In My Zone

Maps on watchOS 10 with a gorgeous new interface. Buttons in the corners follow the new style and a ring illustrates walking distance and time without getting in the way. I'm struck by the edge-to-edge map and the perfect vibrancy and feel of the corner buttons. There are a lot of contrast tricks at play here. "East Rim Trailhead" has a thick dark border about it to keep it legible and the 10:09 time has a subtle blur under it that's hardly noticeable until you zoom.


Try Something New

Maps on watchOS 10 shows a navigation bar title for the first time on an English-language device on the right side of the screen under the time. This helps the new watchOS 10 style work, creating room for a corner button in the top left. I think this is a great reminder that we can rethink even the most basic elements of our designs to allow new ideas to come through.


Arrange the Shades

A wonderful demonstration of color, contrast, and size. The vertical and horizontal arrangement of "East Mesa Trail", "Trail", and "Kane County, Utah" give us a great reference for displaying information with three elements.


Thank you for reading UI Designer Weekly. See you next week!


UIDW 48: A look at iPadOS 17

I've previously written about the challenge of designing for iPadOS. Ideas, though they may fill a small portrait rectangle with ease, are much harder to persuade to fill a larger multi-column landscape rectangle. The iPad has space for your design, your content, and your controls, and more.

Apple's announcement of iPadOS 17 gives us our annual info packet filled with design samples, updated references, new rules, and new recommendations. An iPad is a MacBook without a keyboard. An iPad is a large iPhone. An iPad is a tablet.

The design of iPadOS follows its multitalented adventurous home in being many different things. Let's take a look at a few details that stood out to me in the announcement of iPadOS 17 to see what we can learn.

I hope you find something here that you can mix into your own design work. Thank you for reading UI Designer Weekly. —S


I Prefer a Drawer

Notes on iPadOS 17 gains the peculiarly-delightful ability to show a horizontal drawer of page thumbnails for a PDF you've added to your note. If you zoom in to the corner, you'll see there's a button to hide the thumbnails. This positioning on the top and as a horizontal scroll is nice in itself and it supports the edge-to-edge PDF page swipes that are happening below (by staying out of their way).


It's Presented Above Directly

A lot of things on iPadOS appear in the form of popovers and this popover in the new Lock Screen customization area is a wonderful new example. There are no section titles, only a combined "Font & Color" title at the top. One of the hardest-working interface elements we live with has to be that little point on the presenting side of the popover. There's something to the center justification of the color swatches. I think this is a great example of the role "small" interfaces play on the iPad's larger display.


Into Places All Day

iPadOS 17 has brought a new dimension to the home screen with interactive widgets and their tappable, actionable buttons. Widgets now display constant reminders of what makes something look tappable and what makes something look not. This feature may just be a fantastic reminder for us about the "loop" of interactivity, where people see things change when they take an action, because each of these interactive widgets update live when their buttons are pressed. This is a wonderful update for the once-static home screen and a confident extension of the Widgets design language.


Interfaces Paired Along Dimensions

Lock Screens on iPadOS 17 give us a wonderful reminder to use the same shapes in our designs, even at different parts of the experience. If Lock Screens look a certain way, why not let them be edited while they look that same way? If you can see your changes live, you can be confident in each change. I'm aware this may feel like a basic observation, but applied to our own designs, there may be plenty of places where designs show something one way and edit them another. iPadOS 17 here gives us a wonderful reference of ways to navigate that.


Innocently Placing a Dropzone

I was struck by the simplicity of AutoFill's presentation on iPadOS 17. Where intended-but-not-digitized fields are detected, a light blue lightly-rounded rectangle is placed. This feels to me like the right balance of easy to see but also easy to ignore. And again, as we discuss so often, that is all it takes. There aren't more decorations or more embellishments—just the shape. Makes me want to look at my designs to find places where I'm doing too much and a simpler shape would do the job.


Thank you for reading UI Designer Weekly. See you next week.


UIDW 47: A look at macOS Sonoma

This week, we're looking at the coolest new designs that were announced with macOS Sonoma at WWDC23. macOS Sonoma may seem lighter on the scale when it comes to design changes, but there's actually quite a few additions that are on some big-name spots: the Lock Screen, the desktop, and something that I haven't mentioned in this issue but aerial screen savers (finally!). Did you see that they actually move slowly and then come to a stop when you unlock on your Mac, and wherever they stop, that's where your desktop is?

I hope you find something here that you can mix into your own design work. Thank you for reading UI Designer Weekly. —S


A Familiar Face

The new Lock Screen on macOS Sonoma continues the transfer process we saw last year with System Preferences becoming System Settings. This is perhaps a great reminder for us to look at our designs and ask ourselves if any parts look a certain way not because they should, but because they have in the past. I can imagine people opening their MacBook for the first time and instantly feeling comfortable, knowing well where they are.


Paying Attention to Attention

Widgets placed onto the desktop in macOS Sonoma play a wonderful trick to become less distracting when desired. When you start working with an application, widgets on the desktop fade and blend into your desktop wallpaper. I think this is a great example of how we can think hard about what our designs need and get creative. It's an advanced thought that maybe if the widgets were to fade and blend, they'd be easier to ignore and yet still easy to see. Color, depth, interactivity, affordances, all at play. We can put this kind of thinking into our own complex situations.


You Could Think Conventionally Unconventionally

Widgets on macOS Sonoma are added to the desktop from a drawer of widgets that looks like the one on iOS and iPadOS. This strikes me as interesting because the macOS design language has plenty of possible ways to represent this sort of design, whether you'd call it a "temporary window" or a "picker panel" or a "drag-and-drop zone". But, even though those options exist, we see this drawer designed in a way that more closely mirrors widgets where they are at home: on iOS and iPadOS. I think this is a great reminder that it's okay for us to use something other than what the defaults are on a given platform when we may see great familiarity and usability benefits as a result. Maybe the fact that this design is so uncommon on macOS to this point actually helps it feel even more transient.


There's a State for That

Screen Sharing on macOS Sonoma has a new feature called Presenter Overlay that lets you put yourself over your shared window picture-in-picture style. There's a great example in here of designing for an "off" state: the first button on the left permanently says "Off" and is highlighted when there is no overlay. We might not always have room in our designs to have a special button or toggle just for the "Off" state, but with activities and actions that are more complex, perhaps we can provide that extra bit of clarification.


UIDW 46: A look at iOS 17

As much as good design is about “taking things away”, it can also be about adding things in. To me, this is what iOS 17 and before it iOS 15 and 16 embody most.

Apple Design has not needed a “big redesign” to keep iOS looking and feeling modern. It feels to me like it’s been more a story of enrichment and refinement.

The vibrancies of color, the arrangements of typography. Spacing, shadows, sizes, and pairings. Year by year, the new version of iOS has debuted new tricks, new solutions to old problems.

This week, I’ll share with you the details that caught my eye in the design of iOS 17. Seventeen is a big number and designs were made to match.

I hope you find something here that you can mix into your own design work. Thank you for reading UI Designer Weekly. —S


BYOP: Bring Your Own Paint

Contact Posters on iOS 17 extend the use of the easy font choices, color palettes, and photo styles that people might be familiar with if they've customized their Lock Screen. I'm struck by how Apple Design has been able to expand this set of different pieces people can use while keeping it looking like Apple. This might be a sign that designs throughout our apps should have customization built-in by default. If the system itself allows it in more places, our designs within apps can find ways to join the fun.


BYOT: Bring Your Own Theme

I love this screenshot of Check In, a new feature on iOS 17, for its bountiful usage of yellow. By using yellow throughout, as opposed to having a Check In icon be the only spot of color for example, the entire element says Check In and associates itself with the app. I think this is a great reminder that we can look for places within our own designs to bring color up and out. We can start with concepts that have colors associated with them today, like success for green and warning for yellow, and go beyond to concepts that might be specific to our own designs, like scheduled or processing.


BYOQ: Bring Your Own Quiet

Messages on iOS 17 had a small detail that stuck out to me in the highlight of the emoji icon in the toolbar for picking an iMessage app. The highlight is so calm, so quiet, a gray. I like it a lot and it feels like a choice that allows the toolbar to stay out of competing with the content below. iOS 17 felt quieter and vibrant, spaced out and light.


BYOC: Bring Your Own Color

Continuing that feeling of space and light is Journal, new to iOS 17. It's fascinating seeing how Apple would design a journal and immediately we see a fluency in design with various types of things. To me, one of the strengths of Apple software and design is how good it is at representing different things together. Here, we see a photo, a podcast, a Maps location, and more all grouped together beautifully into an element showing your day. There isn't much fanfare telling us this thing is different from that thing, because we can just tell by looking. But there's still a bravery, confidence, and grace to how this is done.


BYOF: Bring Your Own Functionality

Talking about representing different "things" together, we can't miss talking about StandBy, also new to iOS 17. The design of StandBy is stunning to me in the way that it reuses the design of Widgets and allows many other design elements to breathe. The time is represented in large, bold type. Colors adapt to let you sleep by dimming to polite reds. Swipes up and down on either side allow you to move through your StandBy widgets (like you would with Widget Stacks on the Home Screen). This is that fluency again and, powered by the design decision to allow the iPhone to go into a Dark Mode-only, landscape-only bedside mode, allows these designs to go further.


BYOS: Bring Your Own Skeuomorphism

I love this clock shown in StandBy on iOS 17. It looks like SF Expanded, with the familiar clock hands but with the classic dial. Seeing the Apple Design language express the form of a classic clock like this inspires me to look for new forms of skeuomorphism and ties to the things people are most familiar with in life. This is a great reminder to think about what our designs do at a higher level and think about whether there's something out there we can bring in to make things easier or more enjoyable for people.


UIDW 45: A look at visionOS, the great invention

There are always things we can't do that we wish we could. Life teaches this lesson and makes sure to review it with us (too often, if you'd ask me.)

Great art, great songs, and great inventions though, these tell us we can do what we never dreamed we could.

As I'm writing this newsletter, I'm sitting in my bedroom typing on my MacBook Pro. If I hadn't seen visionOS, I probably wouldn't be thinking right now about how I could be looking up and working with life-size floating windows, rather than looking down at my finite-feeling MacBook screen.

Everything I think of visionOS can be boiled down to "Wow, that thing looks like a normal window. That's a normal app." Apple has gone and made it look easy, but we all know it must have been anything but.

I hope you find something here that you can mix into your own design work. And I hope this gets you excited for what we'll be doing when this releases. Thank you for reading UI Designer Weekly. —S


Windows

Windows in visionOS float in your space. They use a glass-like material to let you get a sense of what's behind. (I can't believe there's more) You can use the window bar, the longer line below the window, to move the window around your space and guess what? Windows will always subtly rotate to be facing you directly. Sounds to me like an excellent example of making something hard to mess up, because you can't leave a window in a "wrong" position. The Principles of Spatial Design session further states that windows adapt to the lighting conditions of your space. I'm struck not only by how beautiful these windows look, but by how functional they appear to be. For example, you can scale windows manually using a small corner control that appears and closely resembles a similar control found in Stage Manager on iPadOS. Wow.‌


Tab Bars and Toolbars

That isn't even the half of it. Windows and familiar design elements like Tab Bars and Toolbars situate together in this amazing layered setup, where the bars always float on a layer above the window. Apple says this makes them easier to access. I'm stunned by how good tabs look arranged vertically on the side, and the fact that these tabs are cognitively the same tabs and the same SF Symbols as you can use on the other platforms.


Light and Shadow

Windows in visionOS adapt to the lighting condition of your space. Safari on visionOS highlights these lighting effects all in the search bar area. I can count at least five separate enhancements to the search bar and the surrounding elements that are purely to establish realistic lighting. The highlights on the tops, the shadows on the bottom, the three-dimensional lighting reflecting off the curved edges between layers. Again, I'm stunned.


Design Sample: Keynote

I can best describe Keynote on visionOS as "this looks too good to be true" or "there is no way there is a full version of Keynote that works so well and appears so beautifully". I think there are a couple of points to focus on here. First is the fact that Keynote on visionOS looks like Keynote on anythingElseOS. Maybe that is not surprising to you, dear reader, but I didn't know we could expect it to be wonderfully 1:1 like this. Second, the visionOS design language can support full-on apps like Keynote. The way things translate, all of it is there such that you can use Keynote in a way that, from these screenshots, appears like you'd be missing exactly zero of the features.


Design Sample: Safari

Safari on visionOS features a separation between interface elements where the search bar is in a separate section above the content section, extending the behavior we saw earlier with Tab Bars and Toolbars. A familiar design, encapsulating all the complexity that comes with interacting with the web page content. A great version of Safari being available at launch reminds me of the iPhone and what that did for the web back then.


Design Sample: TV App

A principle of spatial design Apple shared for visionOS is scale and how scale and depth should be used in tandem. In the TV app using an immersive cinema as your environment, the play controls appear much smaller than the screen and much closer. I'm excited and inspired by the idea of designing with depth so literally. We're going to have new things to think about left and right (and back and forth.)


Copyright © 2020-2024 Sahand Nayebaziz