I have an array of identifiers: [INT]. Now I want all the objects to have these identifiers, but must follow the order id in the ID array.
let IDs = [2, 6, 3, 4, 10, 9] let predicate = NSPredicate(format: "id IN %@", IDs) let objects = realm.objects(Item.self).filter(predicate)
But in the end, the objects were ordered differently with identifiers. Is there a way to sort these objects in the correct order?
source share