apple / sample-cloudkit-sharing

MIT License
296 stars 41 forks source link

Migration to SwiftUI App Lifecycle still not possible under iOS 16 #17

Open mmklug opened 2 years ago

mmklug commented 2 years ago

Unfortunately the app (an all apps using CloudKit Share) still requires UIKit Lifecycle (AppDelegate and SceneDelegate) and currently cannot be migrated to SwiftUI Lifecycle because there is no implementation for func windowScene(_ windowScene: UIWindowScene, userDidAcceptCloudKitShareWith cloudKitShareMetadata: CKShare.Metadata) available for a SwiftUI Lifecycle app. This means that basic SwiftUI features like SceneStorage are still not available for apps using CloudKit Share.

voutyras7 commented 1 year ago

I have found that the func windowScene is called when the share link is executed, but only if the app is opened first. Otherwise a sharelink will only launch the app, but not save the shared data in the link. Is there any way to get the function to be observed when the sharelink launches the app? or is this part of the missing functionality?