SwiftUI Weekly - Issue #201
The curated collection of links about SwiftUI. Delivered every Monday.
Reading
Mastering container views in SwiftUI. Sections.
In the previous post, we discussed the basics of the new container APIs introduced in SwiftUI this year. I want to continue the topic by touching on more advanced recomposition APIs that allow us to decompose sections and their content.
Mastering container views in SwiftUI. Values.
In the series final post about container views in SwiftUI, we will discuss container values and how SwiftUI allows us to propagate data through the container view logic. This week, we will learn how to declaratively define and pass container values.
SwiftUI Environment
SwiftUI provides a powerful mechanism called the environment, allowing data to be shared across views in a view hierarchy. This is particularly useful when we need to pass data or configuration information from a parent view down to its children, even if they’re many levels deep. It enhances the flexibility of SwiftUI views and decouples the data source from its destination.
Modular Navigation in SwiftUI: A Comprehensive Guide
Covering how to handle navigation in a SwiftUI project using a modular architecture.
Improve your app's UX with SwiftUI's task view modifier
The .task
view modifier performs “an asynchronous task with a lifetime that matches that of the modified view”. In short, the task starts as soon as the view appears, and SwiftUI will cancel the task if it doesn’t complete before the view disappears.
Understanding TextRenderer to Animate Words
This protocol helps to replace the default text view rendering behaviour and helps you to customise how SwiftUI text is drawn for an entire view tree. Just typing that out felt cool.
Video
MockData, PreviewModifiers and PreviewTraits in SwiftUI
Just a quick little video to show you how you can create a PreviewModifier in SwiftUI to simplify your code and display MockData in your SwiftUI views.