Comments (5)
Hi @joelkraut , thanks for raising this new issue. Actually I am not very clear of your requirements and need your confirmation. So you want to:
Notify your app of the changed records/objects in the changesOp
, right?
from icecream.
@joelkraut Any reason you can't use regular Realm notifications for this?
from icecream.
@caiyue1993: yes, exactly. It could be a notification rather than a completion block, doesn't matter much. Basically I want to be able to act on added/deleted/changed objects once they've been changed from CloudKit.
@insidegui: I'm happy to be wrong here, but I think that would be too general for my purposes. I also do a lot of writing to the database locally (ie not from CloudKit changes), and I don't necessarily want to treat those changes the same way. I don't think Realm notifications provide a mechanism to say in what context the change happened. I could make everything go through the same mechanism, but that might lead to some spaghetti-like code if I'm specifically avoiding acting on new objects when I make them so that a global notification handler can deal with them later.
from icecream.
@joelkraut Well, I guess that I've known what you wanna do. You want to act differently from data changes from local and data changes from CloudKit.
So:
- If you don't need to do anything due to the local database change, I suggest you looking at the
commitWrite(withoutNotifying:)
method in Realm. - If you need to do something due to the local database change, why you don't just do something right there yourself?
So in my opinion, IceCream might not need to add this feature for now(If added, that might lead to some spaghetti-like code to IceCream instead).
However, if you insist you could fork this project, do your own changes and use that. 🙂
from icecream.
I'm gonna close this issue for now. If you have more ideas, we could reopen it. Thanks man!
from icecream.
Related Issues (20)
- is List<CreamAsset>() legal?
- 更新到2.0.4,在iOS15下依然崩溃 HOT 3
- Is it possible to use prebuilt Realm framework along with IceCream? HOT 1
- IceCream Doesn't work with SwiftUI Preview HOT 1
- 请教一下,当我同时需要同步私有库和公共库的时候,应该用哪种写法呢? HOT 1
- where is ListBase? HOT 1
- Permission Denied HOT 1
- what do uListElementType,vListElementType,wListElementType mean, does Syncobject support up to three type of list at most?
- crash in resumeLongLivedOperationIfPossible HOT 2
- Migration not working
- Sync UserDefault Key-Value using IceCream
- Warning about use of private API when uploading app with Xcode 14 HOT 1
- Generic class 'SyncObject' requires that 'String' inherit from 'RealmSwiftObject' HOT 1
- Cannot find type 'ListBase' in scope HOT 1
- deleted data cannot sync to private database
- Continuing the sync again after the sync was interrupted does not restore the relationship
- Merge latest realm support to 'realm-latest' branch HOT 1
- Migration succeeds when app is offline but when becomes online, local objects are replaced with iCloud objects due to which local objects lose data HOT 1
- How to ignore an Object with specific type sync to cloud? HOT 1
- Unable to Compile/'
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from icecream.