SwiftUI
Grouping Liquid Glass components using glassEffectUnion on iOS 26
Published on: July 2, 2025On iOS 26 we have lots of new ways to reimagine our UIs with Liquid Glass. This means that we can take a look at Apple’s built-in applications and find interesting applications of Liquid Glass that we can use to enhance our understanding of how Liquid Glass components can be built, and to understand what Apple considers to be good practice for Liquid Glass interfaces. In this post, we’re going to replicate a control that’s part of the new maps app. It’s a vertical stack of two buttons in a single Liquid Glass container. Here’s what the component looks like...
Read more...Designing custom UI with Liquid Glass on iOS 26
Published on: July 1, 2025Liquid Glass is iOS 26’s new design language. This means that a lot of apps will be adopting a new UI philosophy that might require some significant changes to how you’re designing your app’s UI. If you’re not ready to adopt Liquid Glass just yet, Apple has provided you an escape hatch that should be usable until the next major iOS release. I recently explored updating my workout app Maxine to work well with Liquid Glass tab bars which you can learn more about here. In this post, I’d like to explore how we can build custom Liquid Glass components...
Read more...Exploring tab bars on iOS 26 with Liquid Glass
Published on: June 19, 2025When your app has a tab bar and you recompile it using Xcode 26, you will automatically see that your tab bar has a new look and feel based on Liquid Glass. In this blog post, we’ll explore the new tab bar, and which new capabilities we’ve gained with the Liquid Glass redesign. I’ll also spend a little bit of time on providing some tips around how you can conditionally apply iOS 26 specific view modifiers to your tab bar using Dave DeLong’s “Backport” approach. By the end of this post you’ll have a much better sense of how Liquid...
Read more...Choosing between LazyVStack, List, and VStack in SwiftUI
Published on: May 8, 2025SwiftUI offers several approaches to building lists of content. You can use a VStack if your list consists of a bunch of elements that should be placed on top of each other. Or you can use a LazyVStack if your list is really long. And in other cases, a List might make more sense. In this post, I’d like to take a look at each of these components, outline their strengths and weaknesses and hopefully provide you with some insights about how you can decide between these three components that all place content on top of each other. We’ll start...
Read more...Using Instruments to profile a SwiftUI app
Published on: April 16, 2025A key skill for every app developer is being able to profile your app's performance. Your app might look great on the surface, but if it doesn’t perform well, it’s going to feel off—sometimes subtly, sometimes very noticeably. Beautiful animations, slick interactions, and large data sets all fall flat if the app feels sluggish or unresponsive. Great apps respond instantly. They show that you’ve tapped something right away, and they make interactions feel smooth and satisfying. To make sure your app behaves like that, you’ll need to keep an eye on its performance. In this post, we’ll look at how...
Read more...Getting started with Mesh Gradients on iOS 18
Published on: September 25, 2024With iOS 18, we have the possibility to create mesh gradients. Mesh gradients are a really nice way to create very cool UI effects. In this post, we're going to explore exactly what mesh gradients are, how we can use them, and how we can even animate them to look really cool. We’ll start off looking at how we can create a mesh gradient. We're going to take a look at how it more or less works, and then we'll also look at what we can animate and how we can play with mesh gradients. At the end of the...
Read more...Animating SF Symbols on iOS 18
Published on: September 4, 2024Over the years, Apple has been putting tons of work into the SF Symbols catalog. With SF Symbols, we’re able to leverage built-in iconography that will look familiar to users while also fitting into the Apple ecosystem very nicely. The fact that there’s thousands of symbols to choose from makes it a highly flexible and powerful catalog of icons that, in my opinion, should be every designer and developer’s first choice when they’re looking for visual components to add to their apps. Initially, SF Symbols were pretty much static. We could configure them with a color and thickness but that...
Read more...Adding values to the SwiftUI environment with Xcode 16’s Entry macro
Published on: July 15, 2024Adding custom values to SwiftUI’s environment has never been very hard to do to. However, the syntax for doing it is verbose and easy to forget. To refresh your mind, take a look at this post where I explain how to add your own environment values to a SwiftUI view. To summarize what’s shown in that post; here’s how you add a custom value to the environment using Xcode 15 and earlier: private struct DateFormatterKey: EnvironmentKey { static let defaultValue: DateFormatter = { let formatter = DateFormatter() formatter.locale = Locale(identifier: "en_US_POSIX") formatter.dateFormat = "MM/dd/yyyy" return formatter }() } extension EnvironmentValues...
Read more...Using PreviewModifier to build a previewing environment
Published on: July 10, 2024Xcode 16 and iOS 18 come with a feature that allows us to build elaborate preview environments using a new PreviewModifier protocol. This protocol allows us to define objects that can create a single context or environment that’s cached and used across your SwiftUI previews. This is useful because it means that you could, for example, populate a database with a bunch of mock data that is then used in your previews. You can also use PreviewModifier to apply specific styling to your previews, to wrap them all in a specific wrapper, and more. Essentially, they’re a tool that allows...
Read more...Mixing colors in SwiftUI and Xcode 16
Published on: June 18, 2024SwiftUI in iOS 18 and macOS 15 has gained a new trick; it can mix colors. This means that it’s now possible to take a color and modify it by applying another color to it using a provided percentage. The video below shows how this works: Notice how the large rectangle updates its color to be a certain mix of a left and right color. In the video I use distinct colors but you can also mix with white or black to lighten or darken your color. One use of color mixing I like a lot is to explore color...
Read more...