I’m using Realm Swift and have lists of embedded objects that I want to combine and sort.
Specifically, I have an embedded object called Hunter in a scavenger hunt app.
At least one Hunter is hosting the scavenger hunt, so they are in a hunt.hosts list. (other hunters can be added as hosts as well, the reason this is a list).
There is also a list of type Hunter in a hunt.hunters list.
I’d like to show a list sorted by score that includes both. Kind of like:
[hunt.hosts, hunt.hunters].sorted("score", ascending: true)
I could do this by mapping all of the objects into a new array, but then I lose the live updates. Is there a way to combine multiple lists of the same type of EmbeddedObjects?
If not, I can rethink my structure, but it would be awesome if this was possible.
Thanks.
–Kurt