Wrapping Up

Threading is an extremely difficult subject. Very few developers get it right, and even those few still manage to make mistakes in this area. Threading is arguably one of the hardest concepts in computer science.

Threading with Core Data used to be extremely difficult to get right. Now with having only main queue and private queue contexts, it has gotten a lot simpler and it boils down to a simple Boolean decision. If you’re working with the UI, then you should be using a main queue context. If you aren’t, then you should be using a private queue context.

However, even with this threading model, there are still times when a lot of work needs to be done on the data in a short period of time. For those rare situations, the Core Data ...

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.