I am currently having issues with the implementation of a SwiftUI share sheet for an iOS16 application that I want to develop. I Implemented the share sheet using ShareLink that I want to customize with a SharePreview. The item I want to share is a simple link.
I implemented the share sheet exactly like described in Apple's documentation:
ShareLink(
item: URL(string: "https://developer.apple.com/xcode/swiftui/")!,
preview: SharePreview(
"SwiftUI",
image: Image("SwiftUI")
)
)
This, results in a weird share sheet that only has one action for creating a "New Quick Note".
What I want to achieve, however, is a "normal" share sheet with all available share options. But I was only able to make this happen by deleting the custom SharePreview, as shown below.
ShareLink(
item: URL(string: "https://developer.apple.com/xcode/swiftui/")!
)
So: Is this the bug or am I doing something wrong here? Any help is much appreciated :)
I'm pretty sure this is a bug. I get the same issue when sharing a simple String and providing a preview image. I was able to get all of the share options by adding a blank message to the ShareLink.
Hope this helps!