Instance Property


The managed object context associated with the main queue. (read-only)


var viewContext: NSManagedObjectContext { get }


This property contains a reference to the NSManagedObjectContext that is created and owned by the persistent container which is associated with the main queue of the application. This context is created automatically as part of the initialization of the persistent container.

This context is associated directly with the NSPersistentStoreCoordinator and is non-generational by default.

See Also

Accessing the Context(s)

func newBackgroundContext() -> NSManagedObjectContext

Creates a private managed object context.

func performBackgroundTask((NSManagedObjectContext) -> Void)

Causes the persistent container to execute the block against a new private queue context.