Last active
April 23, 2017 10:49
-
-
Save cristibaluta/a6ca68b35cdd03e83d1a2cd46c14cf8c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension CloudKitRepository { | |
func fetchRecords (ofType type: String, predicate: NSPredicate, completion: @escaping ((_ ctask: [CKRecord]?) -> Void)) { | |
let query = CKQuery(recordType: type, predicate: predicate) | |
privateDB.perform(query, inZoneWith: customZone.zoneID) { (results: [CKRecord]?, error) in | |
if let results = results { | |
completion(results) | |
} else { | |
completion(nil) | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment