Using ShareLink shows a Share button so it opens Share popup when user taps on that button.
ShareLink(item: data, subject: Text("Subject"), message: Text("Message"))
I would like to programmatically screenshot and then share on share popup. Is there any way to perform action when user taps on ShareLink button or programmatically open SharePopup like we used to do in Swift as UIActivityController ?
You can do this by wrapping a
UIActivityController
inUIViewControllerRepresentable
.In this example, I'm creating a
UIImage
on the click of a button, and then sharing it viaImageWrapper
which is required as thesheet
needsitem:
to beIdentifiable
: