SwiftUI and UICloudSharingController hate each other

后端 未结 2 2007
离开以前
离开以前 2021-02-06 12:27

I have a project using SwiftUI that requires CloudKit sharing, but I\'m unable to get the UICloudSharingController to play nice in a SwiftUI environment.

2条回答
  •  独厮守ぢ
    2021-02-06 13:22

    Maybe just use rootViewController.

    let window = UIApplication.shared.windows.filter { type(of: $0) == UIWindow.self }.first
    window?.rootViewController?.present(sharingController, animated: true)
    

提交回复
热议问题