bda*_*ash 17
从Realm Swift v0.95.0开始,给定Realm存储的类集可以通过objectTypes属性Realm.Configuration设置.
let configA = Realm.Configuration(fileURL: realmFileURL,
objectTypes: [Dog.self, Owner.self])
let realmA = Realm(configuration: configA)
let configB = Realm.Configuration(fileURL: otherRealmFileURL,
objectTypes: [Product.self])
let realmB = Realm(configuration: configB)
Run Code Online (Sandbox Code Playgroud)
realmA只能专卖店实例Dog和Owner,而realmB只能存储的实例Product.