Realm Swift0.95.0でAPIが色々変わったので、メモ。
ChangeLog
Migrationの書き方
AppDelegate
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
//↓↓↓↓
let config = Realm.Configuration(
schemaVersion: 1,
migrationBlock: { migration, oldSchemaVersion in
if (oldSchemaVersion < 1) {
}
})
Realm.Configuration.defaultConfiguration = config
let realm = Realm()
//↑↑↑↑