I figured it out. I had a parent-child relationship between meals and ratings.
class Meal: Identifiable {
var id: UUID = UUID()
var name: String = ""
...
var ratings: [Rating]? = [] // made this optional
...
}
@Model
class Rating: Identifiable {
var id: UUID = UUID()
var value: Int = 0
var date: Date = Date()
var meal: Meal? // added this
...
}
without ratings being optional and a meal? attribute on ratings, the app couldn't create the schemer in cloud kit. It then went ahead and created the scheme as locally on the devices instead.
Once I made these changes to the data model, the app created the schema in cloudkit.
Otherwise it was creating them locally on the device and it looked like the app was working fine.
Thanks
Topic:
App & System Services
SubTopic:
iCloud & Data
Tags: