I’m having issues when tapping buttons that either open the share sheet or email.
Behavior –
Does not work when app is launched after install. Works fine after restarting app.
UIApplication.shared.windows.first?.rootViewController?.present(shareController, animated: true, completion: nil)
Behavior –
Works fine when app is launched after install. Does not work after restarting app.
UIApplication.shared.windows.first?.rootViewController!.presentedViewController?.present(shareController, animated: true, completion: nil)
Log details:
Attempt to present which is already presenting.
ShareSheet connection invalidated.
I need this to work in both scenarios.
2
Answers
This worked for me earlier today:
Extension:
To present:
Here’s a way to handle it: