In working with CloudKit, all types need to be Objective-C foundation classes. Since most types used in CloudKit are bridged from Swift to Obj-C there isn't any issue (i.e.
record[key] = 1 as NSNumber
Array<String>
record[key] = ([myString] as [NSString]) as NSArray
Just bridging will work, together with NSArray
's array
constructor:
let a = ["a", "bc", "def"]
let nsa = NSArray(array: a)
nsa[0] is NSString // *** true ***