SwiftData: a Quickstart

Learn to persist your data in Swift with the brand new Framework SwiftData

Alessandro Manilii
7 min readJan 5, 2024
Picture by panumas nikhomkhai: https://www.pexels.com/it-it/foto/foto-ravvicinata-dell-impianto-minerario-1148820/

Several months have passed since the release of iOS 17, and the new Apple operating system is now widespread on more than 50% of devices out there. The time has therefore come to actively get to grips with one of the new Frameworks introduced by the Cupertino company last June: SwiftData.

When I began developing for iOS, almost 10 years ago, to save a complex amount of data on Apple mobile devices, it was necessary to use one of the most difficult and unwieldy Frameworks, with an extremely steep learning curve and many obscure parts: CoreData. Luckily for you, times have changed!

Following the introduction of SwiftUI, with all its modern logic, Apple thought it wise to modernize CoreData by building on its foundations a new way to persist data… a way so simple to use that, nowadays, saving data in apps has become embarrassingly easy!

In this article, I will show you how to implement simple CRUD (Create, Read, Update and Delete) system in your application.

Everything you need to know about SwiftData can be found in this amazing book: SwiftData Mastery in SwiftUI

--

--

Alessandro Manilii

I’m an Italian professional iOS Developer, iOS Tech Lead at Wakala — Join Medium from the following link: https://medium.com/@alessandromanilii/membership