我将此配置代码用于Realm Encryption
let configuration = Realm.Configuration(encryptionKey: "key" as Data)
let realm = try! Realm(configuration: configuration)
Run Code Online (Sandbox Code Playgroud)
我将此配置代码用于Realm Sync与服务器
let configuration = Realm.Configuration(syncConfiguration: SyncConfiguration(user: user, realmURL: syncServerURL))
let realm = try! Realm(configuration: configuration)
Run Code Online (Sandbox Code Playgroud)
我们如何使用Realm进行加密和与服务器同步?
如果您想指定配置的多个方面,初始化程序Realm.Configuration可以接受多个参数:
let config = Realm.Configuration(syncConfiguration: SyncConfiguration(user: user, realmURL: syncServerURL),
encryptionKey: theKey)
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
304 次 |
| 最近记录: |