Direct NSManagedObjectContext to iCloud

If you’ve been using Core Data for a while, you’ll feel right at home creating a Core Data stack; otherwise, this code will look similar to the stack we discussed in Chapter 2, Under the Hood. The code to add iCloud to the Core Data stack is short, straightforward, and easy to add. This is good and bad. It’s good, in that it takes a small amount of effort to add iCloud to your Core Data–based application, but it’s bad because there aren’t very many options to configure, and it’s a one-size-fits-all design. If your data model is complex or if you have elements that you don’t want to sync, then lack of configurability will cause some interesting solutions. For example, if you have nonsyncable data, then ...

Get Core Data in Swift now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.