Leave a rating/review
You’ve now experienced the full Core Data loop - creating, saving, fetching, and finally displaying data. Let’s recap what you’ve learned in this part of the course before moving onto some more advanced topics.
Once you have a bunch of objects saved to the persistent store you learned how to fetch them by defining and executing fetch requests. You learned how to do this in two ways - using the property wrapper FetchRequest and then using the type directly. Both of these give you the same end result.
To this fetch request you learned how to sort the incoming data using sort descriptors and key paths.
You also learned how to filter this data using predicates. Predicates are a really powerful aspect of Core Data and you got started by looking into key value and object value format specifiers.
From there you learned how to add relationships to your entities by adding your rocket launches to lists. When using relationships Core Data does a lot of the work for you by automatically fetching data associated with the relationship. And you learned how to leverage this functionality in your app.
You also took the time to understand how you could write this logic by hand using compound predicates.
You then put all this to the test by implementing Tag functionality in your app. You modified the object graph to add another entity and added a new view to display tags associated with rocket launches.
Finally you ended by looking at transient properties and how they can be used to house logic in your managed objects. This allowed you to utilize many features of Core Data like undo, redo and validation without persisting every single data point.
You’ve learned a lot at this point - but there is still more to learn! In the next part of the course, you’ll learn how to work with asynchronous swift, Core Data delete rules and how to deal with large files. Take a break, and I’ll see you in the next episode.