init(entityName:dictionaryHandler:)
Creates a batch-insertion request for a named managed entity, and specifies a closure that provides data dictionaries for insertion.
Declaration
convenience init(entityName: String, dictionaryHandler handler: @escaping (NSMutableDictionary) -> Bool)Parameters
- entityName:
The name of the managed entity to insert data into.
- handler:
A closure that provides a dictionary that represents an object to insert. The dictionary contains an attribute name key and a value.
Return Value
A batch-insertion request.
Discussion
Core Data repeatedly calls the provided closure until it returns true, then finishes the request and saves the data.