Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Any drawback if CKRecordID.recordName is generated on client?

It could provide a more smooth user experience if recordName is generated on client.

var uuid = NSUUID().UUIDString

Do you know any disadvantage to do it?

like image 971
János Avatar asked Feb 23 '15 16:02

János


2 Answers

recordName is always generated on the client.

If no recordName is supplied by your application the CloudKit framework will generate a UUID on the client side before sending it to the server.

There is no speedup in generating a UUID in your own code versus letting the CloudKit framework generate one for you.

Client-created recordNames exist to help your application map CloudKit records to your own local data storage. If you don't need to do that then you can leave it up to CloudKit.

like image 138
farktronix Avatar answered Nov 11 '22 00:11

farktronix


That should be exactly the designed purpose of the given CKRecordID constructors.

As long as you don't try to insert the same generated ID into multiple records (which might force you to add a little more error handling), I can't see any disadvantages here.

like image 1
Jerrot Avatar answered Nov 11 '22 00:11

Jerrot