It's a well known fact that every app has to support dark mode (and if it doesn't, your users will request it).
In this post, Danijela shows how to define custom colors using an asset catalog, how to reference them using the new asset catalog static properties, and how to apply them to plain
ScrollViews, as well as
Displaying empty state (or zero state) is an important aspect of improving the UX of your app, and in this video, Sean goes over how to use the new
ContentUnavailableView in iOS 17 which makes this really easy to implement.
In the spirit of progressive disclosure, the
ContentUnavailableView provide some meaningful defaults that cover the majority of use cases, but you can easily customise it for advanced use cases. Sean goes a bit wild in the last chapter of the video, but it definitely shows how flexible this view is.
I've written about Using View Modifiers to Display Empty State on my blog before, which might still be interesting if your app needs to run on any iOS version below iOS 17.
Jessie reminded me of this great WWDC presentation.
Building APIs that are easy to use and understand is a challenge. Even if you're a solo developer, working on a side project or just tinkering around, you will notice that the code you wrote yourself feels different from code that an SDK team wrote.
In this talk, Sam Lazarus (who works on the SwiftUI team at Apple) walks us through some key principles for designing APIs that are pleasing to use. Things like considering common use cases, providing intelligent defaults, optimising the call site, and favouring composition sound obvious when you hear them, but Sam not only goes into great detail to show how the SwiftUI team applied them to the code we use on a daily basis, but also how to apply these to your own code.
I love how the entire talk itself progressively reveals the lesson Sam wants us to take away. Well worth watching!
Searching is a very common user interaction in many apps (I should know, working at a company that operates a well-known search engine...), and SwiftUI makes implementing search pretty straight forward with the
.searchable view modifier.
Daniel takes it one step further, and demonstrates how to automatically focus the search bar both on iOS and macOS.