This subscriber is only available from Objective-C, as it is implemented using objectForKeyedSubscript:
and setObject:forKeyedSubscript:
Fortunately, it is easy to extend CKRecord
to enable Swift recharge:
extension CKRecord { subscript(key: String) -> AnyObject! { get { return self.objectForKey(key) } set(newValue) { self.setObject(newValue as CKRecordValue, forKey: key) } } }
NSHipster has a post in Objective-C subscriptip if you want to know more. I am surprised that Swift does not automatically connect.
source share