I'm having the same problems with the same error messages. Has anyone found a solution?
Post
Replies
Boosts
Views
Activity
I switched to the Activity Sheet code that I found here:
https://swiftui.gallery/uploads/code/ShareSheet.html
And now I've got no problem bringing up a Share Sheet over my other sheet. However, I'm having trouble getting it configured to share what I want. I'm trying to share a zip file out of my app. I've got an NSURL to the file, which I can pass with no problem, but it fails when I try to airdrop it. I assume this has something to do with applicationActivities?
Found the answer:
if UIDevice.current.userInterfaceIdiom == .pad {
av.popoverPresentationController?.sourceView = UIApplication.shared.windows.first
av.popoverPresentationController?.sourceRect = CGRect (
x: UIScreen.main.bounds.width / 2.1,
y: UIScreen.main.bounds.height / 2.3,
width: 200, height: 200)
On additional note: it works fine when I simulate it on an iPhone. It's only the iPad simulators that crash. It also crashes running on an actual iPad.
Figured it out. I'm just looking up the correct paths at runtime and modifying the CSS file each time.
Oops never mind, it was my fault. I was hardcoding URLs to the Documents folder without realizing that they can change from runtime to runtime. Fixed now.
Never mind, I found an answer right here: https://stackoverflow.com/questions/64410160/intercept-links-in-wkwebview