How to Popup Native iOS Share Option

1. Add below code onUI Button event and any other event control ui.
2. Add below code

let myWebsite = URL(string: “”)

let text = “This is some text that I want to share.”

let textToShare = [text,myWebsite!] as [Any]
let activityViewController = UIActivityViewController(activityItems: textToShare, applicationActivities: nil)
activityViewController.popoverPresentationController?.sourceView = self.view
self.present(activityViewController, animated: true, completion: nil)

By BBUniversal Team

Leave a Reply

Your email address will not be published. Required fields are marked *