
import Foundation
import CoreData

extension NSManagedObjectContext {

    public var childBackgroundContext: NSManagedObjectContext {
        
        get {
        
            let childContext = NSManagedObjectContext(concurrencyType: NSManagedObjectContextConcurrencyType.privateQueueConcurrencyType)
        
            childContext.parent = self
        
            return childContext
        }
    }
}


import Foundation
import CoreData

extension NSManagedObjectContext {

    public var childBackgroundContext: NSManagedObjectContext {
        
        get {
        
            let childContext = NSManagedObjectContext(concurrencyType: NSManagedObjectContextConcurrencyType.privateQueueConcurrencyType)
        
            childContext.parent = self
            childContext.automaticallyMergesChangesFromParent = true

            return childContext
        }
    }
}

Add automatically merge to parent context for child context
Add automatically merge to parent context for child context
