Using Core Data With SwiftUI - An Introduction
This sample code project is associated with the following guides at andrewcbancroft.com:
- Using Core Data With SwiftUI - An Introduction
- How to Pass NSManagedObjectContext to a SwiftUI View
- How to Use @FetchRequest in SwiftUI
How does Apple intend for us to use Core Data with SwiftUI?
This project demonstrates how to stitch things together.
It's a single-view app that can
- Persist a list of
BlogIdeas to a Core Data persistent store
- Use the new
@FetchRequestproperty wrapper to fetch
- Use the
managedObjectContextto create, update, and delete
Within the code,