每当我设置Realm对象的属性时,我想触发代表远程后端对象的其他对象的更改.
我想知道这是否仍然是推荐的最佳做法:
https://github.com/realm/realm-cocoa/issues/870#issuecomment-54543539
我试图做什么,但不起作用,因为它干扰了Realm:
dynamic var name: String = "" {
willSet(newValue) {
self.name = newValue
self.widgetRemote?.name = newValue
}
}
Run Code Online (Sandbox Code Playgroud)