Seeding a Core Data Persistent Store
Seeding Data Asynchronously
We successfully seeded the Core Data persistent store with hard-coded seed data in the previous episode. While the implementation works fine, it isn't perfect. Seeding the persistent store takes place on the main thread. We invoke the
seed() method in the
viewDidLoad() method of the
NotesViewController class and we insert the managed objects into the main managed object context of the Core Data manager.
Are you ready to step up your game?
Cocoacasts Plus helps Swift and Cocoa developers take their education serious without being overwhelmed.Watch Every Tutorial for $80 per Year