Previous episode: 12. Inserting Data Into the Context
Get immediate access to this and 4,000+ other videos and books.
Take your career further with a Kodeco Personal Plan. With unlimited access to over 40+ books and
4,000+ professional videos in a single subscription, it's simply the best investment you can make in
your development career.
As you can see, Core Data is a really powerful framework but it is only as complicated as you need it to be and it does an excellent job of hiding all its internals from you. This means that you don't need to understand finer details of working with databases and can start using it immediately. Let's recap what you've learned in this course. You learned the different parts of the Core Data Stack and how to initialize that stack in the Persistence.swift file. You learned how to use the Core Data model editor to define entities to model your relationships. You learned how to define attributes on these entities that mapped data points you're trying to represent in your model. Once you flushed out the entities, you know how to create Ennis Managed Objects subclasses to represent them in code. You learned how to do this both automatically and let Xcode and Core Data generate the code, but also how to write it yourself. I find the auto generation the easiest to work with but you can always drop to custom classes or extensions when you need it. Using these subclasses, you learned how to create instances of the entity and to insert them into the context. Once inserted, you also learned how to save it so that the changes are persisted to the data store. That's just one half of the data flow with Core Data though. You also need to be able to fetch data from the database, possibly asynchronously and display it in your app. You can find information about that and more in part two of this course, Core Data Beyond the Basics. when you're ready to blast off, I'll see you there.
All videos. All books.
One low price.
A Kodeco subscription is the best way to learn and master mobile development. Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalog of 50+ books and 4,000+ videos.