Hi,
I have a very simple image gallery app with a share button in the nav bar. When pressed it should show a popover to share, email etc. the image. The popover presents fine, but as soon as you press 'Save Image' the app crashes and it's very unclear why.
Here's the code that presents the controller:
@IBAction func shareButton(_ sender: UIBarButtonItem) {
print("Share button pressed")
if let animal = animal {
let avc = UIActivityViewController.init(activityItems: [animal.image], applicationActivities: nil)
avc.popoverPresentationController?.barButtonItem = sender
self.present(avc, animated: true) {
print("completed")
}
}
}