---
title: didMigrateHandler
framework: coredata
role: symbol
role_heading: Instance Property
path: coredata/nscustommigrationstage/didmigratehandler-2zbss
---

# didMigrateHandler

The handler to execute after the stage runs.

## Declaration

```swift
var didMigrateHandler: ((NSStagedMigrationManager, NSCustomMigrationStage) throws -> Void)? { get set }
```

## Discussion

Discussion Use this handler to perform any cleanup tasks on the persistent store’s data after the migration has run. Access the store using the container property of the handler’s migrationManager parameter.

## See Also

### Assigning event handlers

- [willMigrateHandler](coredata/nscustommigrationstage/willmigratehandler-5wead.md)
