Training

Data Flow in SwiftUI


This hands-on, one day course is for experienced SwiftUI developers who are new to Observable and Swift Data and wish to explore the proper flow of data in a SwiftUI app.

Contact us at inquiries@dimsumthinking.com to book or inquire about this course for your group, company, conference, or public event.

What you'll learn


You've likely used @Published in the past and may have experience with Core Data. In this workshop you'll work with the future of asynchronous data flow with AsyncSequences, Observable, and Swift Data.

We'll begin with a quick look at the familiar case in which state that belongs to the View itself and look at some requirements and best practices for @State and @Binding. Next, we move the state to controllers and models and work with ObservableObjects and @Published. We briefly explore AsyncStreams and AsyncSequences before moving to the all-new Observable APIs. Finally, we see how easy it is to persist model data using the new SwiftData framework.

What you need


You need a Mac running the latest version of Xcode. You'll create projects throughout the day.

Syllabus Highlights


Part I - Getting Started

Body and the basic template

State

The View Lifecycle

Binding

Small Views

Part II - Asynchronous Data Flow

Observable Objects

AsyncStream and AsyncSequences

Observable

Lists

Part III - Before SwiftData

Persistence

ManagedObjectModel

Custom Classes

Call to Action

Part IV - Swift Data

The Model Macro

Relationships

The SwiftData Stack

Queries

Adding Instances

Background threads

More Fun

Related Content


You will find much of this content and more in the book The Mystery of the Mutating Mannequin available from Editors Cut.