SwiftUI Weekly - Issue #151
The curated collection of links about SwiftUI. Delivered every Monday.
Reading
Unidirectional flow in Swift
This week I will talk about the state management approach I have used in my apps for years. We will cover building a predictable, testable, debuggable, and modular state management system in Swift.
The Ultimate Guide to Building SwiftData Applications
SwiftData made its debut at WWDC 2023 as a replacement for the Core Data framework. Serving as a wrapper on top of Core Data, SwiftData enables on-device persistence and seamless syncing to the cloud.
Observation Framework in iOS 17
In SwiftUI, data is a source of truth. SwiftUI view would adapt to the data changes without our intervention.
Set a Preview Shape for Views Presenting Context Menus
When presenting a context menu from a SwiftUI view, it defaults to a rectangle shape. To customize the shape, simply use the .contentShape<S>(_ kind: ContentShapeKinds, _ shape: S)
modifier and use contextMenuPreview
for the first argument, along with the desired shape in the next one.
SwiftUI onChange Deprecation
In iOS 17, Apple deprecated the onChange(of:perform)
view modifier replacing it with two new variations.
Videos
SwiftUI AlignmentGuides
In this video, I want to show you how you can use AlignmentGuides in SwiftUI to align views differently in your UI.