my object looks like this:
object = [[section: "section1", order: "1"], [section: "section2", order: "1"], [section: "section1", order: "2"], [section: "section2", order: "2"]]
I want to sort it to get a result like:
[[section: "section1", order: "1"], [section: "section1", order: "2"], [section: "section2", order: "1"], [section: "section2", order: "2"]]
Therefore, I need to sort in sections and in each section in order.
What am I doing:
return Observable.from(realm .objects(Section.self).sorted(byProperty: "order", ascending: true)
The string "section .." is for reference only, it may be different, so I canβt just use the character to sort. I need a real priority for line X.
source share