CloudKit not returning the most recent data
I am having this issue where I save something to the icloud using CloudKit but immediately fetching the results doesn't return the latest data inserted. Example let todoRecord = CKRecord(recordType: "Todos") todoRecord.setValue(todo, forKey: "todotext") publicDB.saveRecord(todoRecord, completionHandler: { (record, error) -> Void in NSLog("Saved in cloudkit") let predicate = NSPredicate(value: true) let query = CKQuery(recordType: "Todos", predicate: predicate) self.publicDB.performQuery(query, inZoneWithID: nil) { results, error in if error != nil { dispatch_async(dispatch_get_main_queue()) {