File DataPersistence in SwiftUI

Опубликовано: 16 Июль 2026
на канале: Stewart Lynch
3,505
151

This is the second video of the SwiftUI ToDo App series where we are building an ToDoapp from scratch in SwiftUI and then will refactor it to use the Combine Framework. In this video we will be building our data persistence layer. We will using the Codable protocol in Swift to encode and decode our data so that we can save and restore our list of ToDos from a file stored in our app's documents directory.

If you want to support my work, you can buy me a coffee :)
https://ko-fi.com/stewartlynch

******* Download my StewartLynch YouTube Channel Application - Free **********
https://stewartlynch.gumroad.com/l/obsjz

Starter Files (Completed project from the previous video):
http://www.createchsol.com/ToDoAppCou...

Completed Project for this video:
http://www.createchsol.com/ToDoAppCou...

All Tutorials in this series
Introduction:
   • Not another SwiftUI ToDo App!!!  
1. Building the ToDo App in SwiftUI
   • Building the ToDo app in SwiftUI  
2. Data Persistence
   • File DataPersistence in SwiftUI  
3. Meaningful Error Handling
   • Responsible Error Handling In SwiftUI  
4. Combine: PassthroughSubject and .sink
   • Combine   PassthroughSubject and SwiftUI  
5. Combine: Just and @Published PropertyWrapper
   • Combine @Published properties and Just Pub...  
6. Combine: CurrentValueSubject
Coming April 29

Other references made in this video:
A Better Result
   • A Better Result  

Other References:
Stewart Lynch's YouTube Channel:
   / stewartlynch  
Stewart Lynch on Twitter:
  / stewartlynch  
CreaTECH Solutions Website:
https://www.createchsol.com
Stewart Lynch's GitHub:
https://github.com/StewartLynch