I am trying to use Zone Sharing in my SwiftUI app. I have been attempting to get the UICloudSharingController to show an initial share screen to pick users and the mechanism to send the invitation.
From the documentation, it appears that the UICloudSharingController .init(preparationHandler:) API is deprecated so I am not using that approach. Following the Apple documentation, I am creating a Zone Share and NOT saving it and presenting using the UICloudSharingController(share:container:) API. However, this presents a UI that is the 'mgmt' API for a Share. I can get to the UI I was expecting by tapping on the 'Share with More People' option, but I want to start on that screen for the user when they have not shared this before.
So, I found an example app from Apple at: https://github.com/apple/sample-cloudkit-zonesharing. It has the same behavior. So we can simply discuss this problem based on that example code.
How do I get the next View presented when tapping 'Share Group' to be the invitation for new users screen?
Here is the UI it presents initially:
And here is the UI (on the bottom half of the screen) I am trying to start the share process with:
Thanks,
Charlie
Yeah, UICloudSharingController.init(preparationHandler:)
was deprecated. Depending on which UI framework you are using, you can consider using ShareLink
, UIActivityViewController
, or NSSharingServicePicker
to create a new CloudKit share. This is mentioned here. Feel fee to follow up if you have further question when going along the path.
Best,
——
Ziqiao Chen
Worldwide Developer Relations.