Contents

init(entity:dictionaryHandler:)

Creates a batch-insertion request for a managed entity, and specifies a closure that provides data dictionaries for insertion.

Declaration

convenience init(entity: NSEntityDescription, dictionaryHandler handler: @escaping (NSMutableDictionary) -> Bool)

Parameters

  • entity:

    A 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.

See Also

Creating a Request