You can use this approach https://developer.apple.com/forums/thread/650876 and then use the NSPersistentCloudKitContainer instead of NSPersistentContainer. A good explanation of how to integrate the NSPersistentCloudKitContainer properly is here: andrewcbancroft.com/blog/ios-development/data-persistence/getting-started-with-nspersistentcloudkitcontainer/
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: