I have 2 questions regarding context creation.
When i access main context via singleton:
let appDelegate = UIApplication.shared.delegate as! AppDelegate
let managedContext = appDelegate.managedObjectContext
Is that the SAME context everytime?
And if i then create a child context like this:
let bgContext = NSManagedObjectContext(concurrencyType: .privateQueueConcurrencyType)
With Parent as the about main context, is that the SAME child context or is it generating a completely new child context.
Thanks!
Yeah, as long as it's a stored property, appDelegate.managedObjectContext is the same object every time.
And to your second question, that's a new child context. You can go from here to read more from Apple's documentation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With