Beta 2 of DataFlow in SwiftUI is available
The Mystery of the Mutating Mannequin
An Exploration of DataFlow in SwiftUI"I wish I'd understood the material better before I wrote this book!" - the authorNow available with a new chapter that introduces SwiftData"The Mystery of the Mutating Mannequin" is a fun fast-moving tour of the different techniques of flowing data through your SwiftUI app. We start with the simplest of views that contains no state, to those that use simple properties, @State properties, or share state using @Binding. Throughout this journey through things you thought you knew, we use various tools to see which views are redrawn when and why.Next, we manage and persist an object graph manually or go old school with Core Data on your way to learning about the future when we work with SwiftData.Updated for Xcode 15 and Swift 5.9 and tested on Apple Silicon. ContentsChapter 1: Simple ViewsThrough the Window DisplayWe BeginModifiersCompositionRoad MapCreditsChapter 2: View IdentityA Simple ModelStored PropertiesState and MemoryState and IdentityChanging StateAdding a ConditionalIdentityChapter 3: Sharing StateBindingIntroducing JourneyMore BindingsObservableObjectEnvironmentAsyncSequenceObservableBindableBinding and BindableChapter 4: Saving our WorkMultiple JourneysPersistenceAmuse BoucheThe StackThe Managed Object ModelCore Data RelationshipsCustom ClassesFull Circle-ish and BeyondChapter 5: SwiftData Stubbing out the ModelThe Model MacroSwiftData RelationshipsThe SwiftData StackQueriesAdding and DeletingUpdatingSevering Relationships