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 had a similar issue happening where my app would crash despite the fact that I added the default migration code in didFinishLaunchingWithOptions
The problem was that I was indeed initializing an instance of Realm in my first view controller as a class level property. So removing that class level realm object from my first ViewController fixed the issue.
import UIKit
import RealmSwift
class ViewController: UIViewController{
let db = try! Realm() // Removing this solved my issue
func doSomething(){
let db = try! Realm() // Placed this here instead
}
}
I instead created the object inside the function that needed it, which is a better approach anyway.