-
-
Notifications
You must be signed in to change notification settings - Fork 478
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
531 additions
and
338 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// | ||
// RealmConfiguration.swift | ||
// NotificationServiceExtension | ||
// | ||
// Created by huangfeng on 2024/5/29. | ||
// Copyright © 2024 Fin. All rights reserved. | ||
// | ||
|
||
@_exported import RealmSwift | ||
import UIKit | ||
|
||
let kRealmDefaultConfiguration = { | ||
let groupUrl = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: "group.bark") | ||
let fileUrl = groupUrl?.appendingPathComponent("bark.realm") | ||
let config = Realm.Configuration( | ||
fileURL: fileUrl, | ||
schemaVersion: 13, | ||
migrationBlock: { _, oldSchemaVersion in | ||
// We haven’t migrated anything yet, so oldSchemaVersion == 0 | ||
if oldSchemaVersion < 1 { | ||
// Nothing to do! | ||
// Realm will automatically detect new properties and removed properties | ||
// And will update the schema on disk automatically | ||
} | ||
} | ||
) | ||
return config | ||
}() |
Oops, something went wrong.