Replies: 1 comment 1 reply
-
You can use Realm in your NickData package and propagate the data to the View. You would need to have the ViewModel be an |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, all.
I'm interested in using Realm, but in my architecture the Swift UI project (NickApp) doesn't know how data access occurs. All data calls are made through a referenced Swift package, NickData.
Suppose my functionality is the same as the sample tasks app on mongo's site. I want NickData to use RealmSync, but not to have any UI. So the Item (or Task) is in NickData and changes to it sync to mongo, etc. NickData maps "Item" to "ItemViewModel" (for example) and gives "ItemViewModel" to NickApp, which displays it in ItemView.
It seems, however, that Realm Swift is very tightly coupled to Swift UI. Call me old-fashioned, but the idea of my presentation layer knowing the internals of objects that are in my data layer doesn't sit well. Can anyone point me to a working sample solution that is architected as I described? Or, can anyone give me any guidance on what I have to do to make this work?
Beta Was this translation helpful? Give feedback.
All reactions