Are there any samples of how house CloudKit in SwiftUI?

I have used cloudkit for years untill swiftUI came out. I just dont get how to instigate it. Are there any samples of how to use Cloudkit with SwiftUI?

Replies

I don't see any Apple samples, if that's what you're asking. Feel free to file a request via the bug reporter/suggestions, being sure to add your report # to your thread for reference, thanks and good luck.

“What are you trying to do?”


If you're looking for ways to bind your CloudKit types into a SwiftUI view's state, look at the ObservableObject protocol and @Published property wrapper from the Combine framework—that's how CoreData's NSManagedObject has been bridged in. Go through Apple's SwiftUI tutorials to learn about state management in SwiftUI; the important takeaway is that SwiftUI views are a function of state, so everything you work with is just the state itself, and SwiftUI will arrange for your views to be updated.


Combine support for CloudKit sounds like a fun side-project for someone though.