Class

NSEntityMigrationPolicy

A policy instance that customizes the migration process for an entity mapping.

Declaration

class NSEntityMigrationPolicy : NSObject

Overview

You set the policy for an entity mapping by passing the name of the migration policy class as the argument to entityMigrationPolicyClassName. Typically, you specify the name in the Xcode mapping model editor.

Topics

Customizing Stages of the Mapping Life Cycle

func begin(NSEntityMapping, with: NSMigrationManager)

Sets up state information before the start of a given entity mapping.

func endInstanceCreation(forMapping: NSEntityMapping, manager: NSMigrationManager)

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

func createRelationships(forDestination: NSManagedObject, in: NSEntityMapping, manager: NSMigrationManager)

Constructs the relationships between the newly-created destination instances.

func endRelationshipCreation(forMapping: NSEntityMapping, manager: NSMigrationManager)

Indicates the end of the relationship creation stage for the specified entity mapping.

func performCustomValidation(forMapping: NSEntityMapping, manager: NSMigrationManager)

Provides the option to perform custom validation on migrated objects during the validation stage of the entity migration policy.

func end(NSEntityMapping, manager: NSMigrationManager)

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

Constants

let NSMigrationManagerKey: String

Key for the migration manager.

let NSMigrationSourceObjectKey: String

Key for the source object.

let NSMigrationDestinationObjectKey: String

Key for the destination object.

let NSMigrationEntityMappingKey: String

Key for the entity mapping object.

let NSMigrationPropertyMappingKey: String

Key for the property mapping object.

let NSMigrationEntityPolicyKey: String

Key for the entity migration policy object.

Relationships

Inherits From

Conforms To

See Also

Entity Mapping

class NSMigrationManager

A migration manager instance that performs a migration of data from one persistent store to another using a given mapping model.

class NSMappingModel

A model instance that specifies how to map a model from a source to a destination managed object model.

class NSEntityMapping

A mapping instance that specifies how to map an entity from a source to a destination managed object model.

enum NSEntityMappingType

Data type used for constants that specify types of entity mapping.

class NSPropertyMapping

A mapping instance that specifies in a model how to map from a property in a source entity to a property in a destination entity.