I am now working with the new SwiftUI 4.0 and using the new ShareLink feature . How can I know if a link or text has been shared successfully, any suggestions would be great ? I have a simple ShareLink like this
ShareLink(item: InviteMessage) {
Text("Test Share")
.foregroundColor(.black)
}
before in SwiftUI 3.0 I would use this code
.background(SharingViewController(isPresenting: $InviteOthers) {
let message = "Share Me"
let av = UIActivityViewController(activityItems: [message], applicationActivities: nil)
av.completionWithItemsHandler = { (activity, success, items, error) in
if success {
// shared successfully update count
}
}
return av
})