Functions
The following functions are available globally.
-
Attempts to commit unsaved changes to registered objects in the context. This function is performed in a block on the context’s queue. If the context has no changes, then this function returns immediately and the completion block is not called.
Declaration
Swift
public func saveContext(_ context: NSManagedObjectContext, wait: Bool = true, completion: ((SaveResult) -> Void)? = nil)
Parameters
context
The managed object context to save.
wait
If
true
(the default), saves synchronously. Iffalse
, saves asynchronously.completion
The closure to be executed when the save operation completes.