According to the articles I have read the correct way to enable core data light weight migrations is by passing options to addPersistentStoreWithType
:
You do it using NSPersistentStoreDescription
, which is where all those options moved to in the Swift 3 updates. Do this before the call to loadPersistentStores
:
let description = NSPersistentStoreDescription()
description.shouldInferMappingModelAutomatically = true
description.shouldMigrateStoreAutomatically = true
container.persistentStoreDescriptions = [description]