An Introduction to SwiftData
SwiftData is the new ORM framework introduced by Apple to replace Core Data. At the time of writing this book, you need to know both frameworks, with the view that in about two years, Core Data will only be used for legacy projects. New projects based on newer versions of the Apple operating system should preferably use SwiftData to implement persistency. SwiftData is less of a great choice if your existing users still use iOS 16 or previous versions of the operating system, or if you need features of Core Data that are yet to be introduced in this new framework. For more advanced uses, you may need to stick to Core Data right now.
This chapter will introduce this new persistence framework that is going to become increasingly important for SwiftUI-based development in the next few years.
SwiftData was announced at the Worldwide Developers Conference (WWDC) 2023. It solves the same problem as Core Data: it allows applications to persist data, that...