print(sender.currentTitle!) // text to share let text = "\(sender.currentTitle!) \n\n Shared from JokesRUs \n https://apps.apple.com/app/d1557776302" // set up activity view controller let textToShare = [ text ] let activityViewController = UIActivityViewController(activityItems: textToShare, applicationActivities: nil) activityViewController.popoverPresentationController?.sourceView = self.view // so that iPads won't crash // exclude some activity types from the list (optional) activityViewController.excludedActivityTypes = [ UIActivity.ActivityType.airDrop ] // present the view controller self.present(activityViewController, animated: true, completion: nil) }