When downloading items from CloudKit, I want to order the results by the creation date. In my opinion, now it is sorted by the first record property.
func loadItems() { let predicate = NSPredicate(value: true) let query = CKQuery(recordType: "Items", predicate: predicate) db.performQuery(query, inZoneWithID: nil) { (results, error) -> Void in if error != nil { println(error.localizedDescription) } dispatch_async(dispatch_get_main_queue()) { () -> Void in items = results as [CKRecord] self.tableView.reloadData() println("items: \(items)") } } }
ios swift icloud cloudkit
colindunn
source share