let config = Realm.Configuration(
// Set the new schema version. This must be greater than the previously used
// version (if you\'ve never set a
I find best solution:
You need add Realm migration code before didFinishLaunchingWithOptions in willFinishLaunchingWithOptions
func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
RealmManager.shared.configureRealm()
return true
}