Just Scratching the Surface
SwiftData has introduced a much simpler way to persist your data in your Swift apps. Thanks to Swift macros, you can instantly make your models, in code, SwiftData ready and configure them to your liking. With a new modifier, you can access the context, and with the new @Query
property wrapper, you can easily perform queries. Oh, did I mention that the @Query
property wrapper is all set up for Observation, so your user interface stays up to date with the database? There’s a lot packed into a little bit of configurable syntax under the hood. Keep an eye out here at Kodeco for more on one of the biggest changes to come out of WWDC 2023!
Where to Go From Here?
WWDC has a great set of videos to get an introduction to SwiftData:
We hope you enjoyed this quick look at SwiftData, and if you have any questions or comments, please join the forum discussion below!