Simplifying Our Entities with SwiftData
Let’s start our journey to mastering iOS 18 with one of the most important and useful frameworks Apple has released in the last few years – SwiftData.
SwiftData is an excellent example of Swift macro usage, taking the old and beloved Core Data framework to a whole new level of simplicity and adapting it to the modern world of Swift and declarative programming.
In this chapter, we will do the following:
- Understand the SwiftData background
 - Define a data model, including its relationships and attributes
 - Learn about the SwiftData container and configurations
 - Fetch and manipulate data using the model context
 - Migrate our data to new version schemas
 
It’s going to be a long ride with an exciting new framework! So, after the technical requirements, let’s start with some background on the framework.