Hi guys,
Can someone help?
I want to get all the isTopConversation ( actually has 0 and 1) equals 1 at the top a few then the rest for the conversation I want sorted by updatedUnixTime. Like:
content, isTopConversation, updatedUnixTime
my current query is like this, but it seems to be that the first isTopConversation is not working.
realm.objects(Conversation).filter(predicate).sorted("isTopConversation", ascending: false).sorted("updatedUnixTime", ascending: false)
Results.sorted has a second overload that takes a sequence of SortDescriptors to sort by:
realm.objects(Conversation).filter(predicate).sorted([SortDescriptor(property: "isTopConversation", ascending: false),
SortDescriptor(property: "updatedUnixTime", ascending: false)])
Nice, thanks Mark! It works, closing issue.
Most helpful comment
Results.sortedhas a second overload that takes a sequence ofSortDescriptors to sort by: