---
title: "endInstanceCreation(forMapping:manager:)"
framework: coredata
role: symbol
role_heading: Instance Method
path: "coredata/nsentitymigrationpolicy/endinstancecreation(formapping:manager:)"
---

# endInstanceCreation(forMapping:manager:)

Indicates the end of the instance creation stage for the specified entity mapping, and the precursor to the next migration stage.

## Declaration

```swift
func endInstanceCreation(forMapping mapping: NSEntityMapping, manager: NSMigrationManager) throws
```

## Parameters

- `mapping`: The mapping object in use.
- `manager`: The migration manager performing the migration.

## Discussion

Discussion You can override this method to clean up state from the creation of destination or to prepare state for the creation of relationships.

## See Also

### Customizing Stages of the Mapping Life Cycle

- [begin(_:with:)](coredata/nsentitymigrationpolicy/begin(_:with:).md)
- [createDestinationInstances(forSource:in:manager:)](coredata/nsentitymigrationpolicy/createdestinationinstances(forsource:in:manager:).md)
- [createRelationships(forDestination:in:manager:)](coredata/nsentitymigrationpolicy/createrelationships(fordestination:in:manager:).md)
- [endRelationshipCreation(forMapping:manager:)](coredata/nsentitymigrationpolicy/endrelationshipcreation(formapping:manager:).md)
- [performCustomValidation(forMapping:manager:)](coredata/nsentitymigrationpolicy/performcustomvalidation(formapping:manager:).md)
- [end(_:manager:)](coredata/nsentitymigrationpolicy/end(_:manager:).md)
