SwiftUI Weekly - Issue #215
The curated collection of links about SwiftUI. Delivered every Monday.
Reading
What's new in Swift 6.2?
Raw identifiers, backtraces, task naming, and more.
SwiftUI View Model Ownership
When we cover SwiftUI’s state system in our workshops, we often get asked: How can I set up my view model in a view? There’s a bit more to this question, so let’s try to spell out the requirements.
Choosing between LazyVStack, List, and VStack in SwiftUI
SwiftUI 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.
Formatting data inside SwiftUI Text views
I’ve just started a new "Nil Coalescing" YouTube channel, and in the first video I take a closer look at how we can use FormatStyle
and Text.DateStyle
directly inside SwiftUI Text
views to format values inline using string interpolation. This approach allows us to display arrays of strings, measurements, dates and other types of data in a clean, declarative way without writing additional formatting code.
Can You use PreferenceKeys for Testing SwiftUI Views
One afternoon I was experimenting with EnvironmentKeys—trying to drive navigation and coordinate between screens without resorting to imperative hacks. SwiftUI’s environment feels like a top‑down broadcast: you inject a value at the root, and child views pick it up. But what if you want the opposite? What if a child view could whisper something back up the tree?