Search code examples
ioscloudkitckrecord

Does subscript operator work for CKRecord?


I want to use subscript operator like docs show: myRecord[@"firstName"] = @"Jacob";

but can't get it to work in Swift.

Any idea why?

enter image description here


Solution

  • On this post you can see an explanation why subscripting CKRecord does not work and why you also can not add your own.

    Stack overflow when defining subscript on CKRecord in Swift

    There is however a sample of a workaround that comes close.