Post

Replies

Boosts

Views

Activity

Core Data Sharing with iCloud Drive Files
I have an app for client management that stores data in Core Data with an NSPersistentCloudKitContainer. Each manager have their clients in the Core Data Private Database, and each client could have associated files (images, documents, etc) that are stored in app's own folder structure in iCloud Drive. Eventually, a manager can decide if to share a client with another manager, in order to have a shared managed client (readable, or writable+readable by others managers which share the same client). This is done by moving the Client from the Private Database to the Shared Database following the Apple's guidelines: https://developer.apple.com/videos/play/wwdc2021/10015/ This is the structure: The problem is: the database record is shared correctly, but the iCloud Drive Files are not shared (obviously). My goal is to get working the iCloud Drive Client Files (every client has a single Folder) with the minimum effort from the user. I cannot get working the iCloud Drive Sharing from my app, only the Core Data Sharing, so (in development environment) I have to share the Client Core Data Info from the App sheet, and then, go to Finder and share the Client's folder and send the link, so it would be a bit confusing for my users. Any approach for get working iCloud Drive File Sharing from the (inside) my app? Generate a link and automatically send to the other user. Or, better, an approach to get working this sharing with a single action from the user (only share once, and it sends the core data info and icloud drive file sharing).
0
0
863
Oct ’21
Share data through CloudKit and Core Data with macOS
I'm trying to replicate the behavior of the iOS sample application provided by Apple in order to share my Core Data objects through CloudKit. I am able to share CKRecords through Mail and Airdrop by obtaining the URL, but I cannot be able to get the iCloud Share modal window. let sharingService = NSSharingService(named: .cloudSharing) sharingService?.delegate = self coredataContainer.share([ManagedObjectToShare], to: nil, completion: { [weak self] objectIDs, shareCK, container, error in if let error = error {  fatalError(error.localizedDescription) } else { self?.sharingService?.perform(withItems: [shareCK?.url]) } }) If I substitute the .cloudSharing for .composeEmail, the modal window opens correctly and provides me an URL to access to the object, but nothing happens when .cloudSharingis seated as SharingService. How can I accomplish this?
0
0
747
Jun ’21