O'Reilly logo

Core Data in Swift by Marcus S. Zarra

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Threading and Core Data

Throughout the life of the Core Data framework, the approach to using Core Data with threading has changed many times. Originally there was no support for threading other than “figure it out,” which evolved into the basic rule of “A context and its data must stay on one thread.”

With the introduction of iOS 5.0 and OS X 10.8, Core Data began utilizing GCD (Grand Central Dispatch) and blocks that were introduced to the overall system in the previous generation. To further define how threading should be approached with Core Data, the threading model was again refined in iOS 8.0 and OS X 10.10 and yet again in iOS 9.0 and OS X 10.11.

With these changes, the threading model for Core Data has become a binary decision. We can ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required