Posts

Showing posts from June, 2018

CoreData With Concurrency: Swift

Image
1.   CREATE & INSERT : Core Data Using CoreData with background queues is very important to avoid blocking the main one with heavy computations. For this reason, we should use concurrency most of the time. In this article we are going to see how to save some objects with CoreData in a background queue. CoreData received a major update with iOS 10. For this reason, in this series, I’ll explain how to achieve our goals in both pre and post iOS 10. Happy Reading! Contents Getting Started iOS 8+ iOS 10+ Getting Started Before starting our journey, we have to create a data model—which we will use for all the further examples. We can use a data model with just an entity  Dog  with a String attribute  name —I know you wanted  Cat . Not today, I prefer dogs  iOS 8+ If we want to be compatible with versions older than iOS 10, the first thing which we should do is creating the CoreData stack manually: 1 2 3 4 5 6 7 8 9 10 11 12 1