---
title: "end(_:manager:)"
framework: coredata
role: symbol
role_heading: Instance Method
path: "coredata/nsentitymigrationpolicy/end(_:manager:)"
---

# end(_:manager:)

Performs cleanup at the end of the migration, from any phase of the mapping.

## Declaration

```swift
func end(_ mapping: NSEntityMapping, manager: NSMigrationManager) throws
```

## Parameters

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

## Discussion

Discussion This is the end to the given entity mapping. You can implement this method to perform any clean-up at the end of the migration (from any of the three phases of the mapping).

## 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)
- [endInstanceCreation(forMapping:manager:)](coredata/nsentitymigrationpolicy/endinstancecreation(formapping: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)
