My code for the share button works well on all versions below iOS 13, How do I modify the coding to work on iOS 13 for both IPad and IPhone?
class CatseyeViewController: BaseViewController{
@IBOutlet weak var sliderImage: UIImageView!
@IBAction func share(_ sender: UIButton) {
let activityController = UIActivityViewController(activityItems:
[self.sliderImage.image as Any], applicationActivities: nil)
self.present(activityController, animated:true, completion: nil)
if let popOver = activityController.popoverPresentationController {
popOver.sourceView = self.view
}
}
}
In order to update the share sheet to work on iOS 13, create an IF/ELSE statement to detect first for iOS 13 versus all other versions.