Understanding SwiftData’s background
To understand SwiftData’s background and its roots, it’s important to go one step backward and learn about the Core Data framework.
Core Data has been the primary data framework for Apple platforms for many years, even before iOS was born.
Core Data was added to iOS in iOS 3, bringing the power of handling a data graph to mobile devices flexibly and efficiently. Note that I haven’t mentioned the word database or persistency, and that’s for a good reason. We should remember that Core Data is not an SQLite wrapper, even though its persistent store is based on SQLite in most cases. The primary goal of Core Data is to handle our app’s data layer.
But what does it mean to handle the app’s data layer? Well, most apps work with several layers – the UI, business logic, and data layer. The data layer is built upon data entities that define the core items that our app works with. For example...