share – iPad crash when presenting exercise controller with iOS 16 and swiftUI
[ad_1]
I get the next crash when presenting a share sheet on the iPad. Works high-quality on an iPhone:
Thread 1: “UIPopoverPresentationController (<UIPopoverPresentationController: 0x13f418e50>) ought to have a non-nil sourceView or barButtonItem set earlier than the presentation happens.”
right here is the code.
let av = UIActivityViewController(activityItems: [path], applicationActivities: nil)
let scenes = UIApplication.shared.connectedScenes
let windowScene = scenes.first as? UIWindowScene
windowScene?.keyWindow?.rootViewController?.current(av, animated: true, completion: nil)
Thanks for the assistance.
Blessings,
–Mark
[ad_2]