CloudKit: Preventing Duplicate Records
问题 I am working through an app that pulls data from an external web service into a private CloudKit database. The app is a single user app, however I am running into a race condition that I am not sure how to avoid. Every record in my external data has a unique identifier that I map to my CKRecord instances. The general app startup flow is: Fetch current CKRecords for the relevant record type. Fetch external records. For every external record, if it doesn't exist in CloudKit, create it via batch