SwiftUI Weekly - Issue #225
The curated collection of links about SwiftUI. Delivered every Monday.
Reading
Task Identity
When you write SwiftUI views, one of the big advantages over UIKit is that SwiftUI performs automatic dependency tracking. Whenever your model invalidates or one of your view’s properties change, your view is re-rendered.
Initializing @Observable classes within the SwiftUI hierarchy
I’ve noticed that many iOS developers, even those who have been working with SwiftUI for a while, still have questions about how @Observable classes work with SwiftUI views, how they should be initialized, and whether we need to store our observable models in @State. In this post, we’ll look at some examples of managing observable state in SwiftUI, explore the recommended approaches, and see what can go wrong if our observable classes are not stored correctly.
Document Preview Options in SwiftUI
Working with documents is a common requirement in many iOS apps. Whether you’re displaying a PDF, showing a Quick Look preview, or handing the file off to the system for deeper interactions, developers today have multiple options available. Each framework offers different capabilities, limitations, and levels of control.
Understanding the Transferable Protocol in Swift
Learn how to prepare your custom types to be sharable between applications and system features with the Transferable protocol.
