-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Observing a Realm object? #38
Comments
Hi @winstondu. Unfortunately yes. The observing which you're looking for is done using ObjectiveC's KVO mechanism... And as you might already know, Swift native types don't support KVO |
I see. But in your library, any write to the Is there no way to know whether the |
Yes, that is possible, but as you already mentioned, you will not know which property exactly was changed. |
@arturdev , what would be the function when using this library to make change observations? |
Hey @arturdev
This seems like an amazing library. However, one useful paradigm we use (with RxRealm) is the ability to observe changes on an object in the realm db and register a callback.
This function is the
public func observe<T>(on queue: DispatchQueue? = nil, _ block: @escaping (RealmSwift.ObjectChange<T>) -> Void) -> RealmSwift.NotificationToken where T : RealmSwift.Object
.Does the fact that the objects are no longer "live" make this no longer possible?
The text was updated successfully, but these errors were encountered: