I followed the documentation for adding CloudKit to my existing project as described at Setting Up Core Data with CloudKit. After running the project on two different simulators I noticed that it was not syncing. This led down a rabbit trail of tutorials which all showed the same steps that I had already completed (add iCloud and Background Modes capabilities and switch NSPersistentContainer to NSPersistentCloudKitContainer).
Core Data+CloudKit not connecting to CloudKit seemed to have the same concern, but following the suggestions there did not help either.
// In my AppDelegate
lazy var persistentContainer: NSPersistentCloudKitContainer = {
let container = NSPersistentCloudKitContainer(name: "CloudTest")
container.loadPersistentStores(completionHandler: { (storeDescription, error) in
if let error = error as NSError? {
fatalError("Unresolved error \(error), \(error.userInfo)")
}
})
container.viewContext.automaticallyMergesChangesFromParent = true
// container.viewContext.mergePolicy = NSMergeByPropertyObjectTrumpMergePolicy
return container
}()
All of my local saving and retrieving is working as it did before. In the iCloud Dashboard no data is showing and telemetry is blank as well. Is there something simple that I am missing?