Core Data: Fundamentals
Learn the basics of Core Data in this beginner series. You’ll learn how to model your data with attributes and relationships, save data using a context, display saved data in lists and much more, in both SwiftUI and UIKit! By Josh Steele.
Learning path
This is part of the iOS Data & Networking learning path. View path.
Who is this for?
Beginners with just a little bit of iOS and Swift experience. This course isn’t suited for intermediate or advanced developers. If that’s you, check out our intermediate or advanced video courses for more ways to level-up your developer skills!
Covered concepts
- Managed object models
- Managed object contexts
- Fetch requests and fetch results
- Sorting data with sort descriptors
- Filtering data with predicates
- Using fetched results controllers to handle data changes
- Storing large files as external data
Part 1: The Core Data Stack
What is Core Data? Find out how it is used to store data in your apps.
Take a high level tour of the Core Data stack and understand what Core Data is and isn’t.
Understand how Core Data represents an app’s data model using managed objects
Core Data needs to keep track of changes to the managed object model and it does this using a managed object context. Get a high level understanding of how a context is used in this episode.
Understand how the persistent store coordinator facilitates communication between the context and underlying data store.
Create a Core Data stack for use in the RocketLaunches app!
Wrap up this section by reviewing what you’ve learned about the Core Data stack, and find out what’s coming up in the next section.
Part 2: Saving Launches
In this episode, you’ll get a look at this part of the course, which covers how to create a data model and save data to the store.
Learn what an Entity is in the Core Data framework and how you can add attributes to model your data.
In this challenge complete the RocketLaunch entity by adding attributes to define your data model.
Understand what managed object subclasses are and how you can use them in code to represent your Core Data model.
Now that you have a RocketLaunch class you can use learn how to populate it and save data to the persistent store.
Wrap up this course by reviewing what you’ve learned about the core data stack, creating data models and persisting entities. Also find out where to go next!