Fix crash when sharing large image on iPad

This commit is contained in:
Shadowfacts 2020-06-15 18:29:04 -04:00
parent 803ba50f53
commit c0316f55ef
Signed by: shadowfacts
GPG Key ID: 94A5AB95422746E5
1 changed files with 3 additions and 0 deletions

View File

@ -227,6 +227,9 @@ class LargeImageViewController: UIViewController, UIScrollViewDelegate, LargeIma
@IBAction func sharePressed(_ sender: Any) {
guard let image = image else { return }
let activityVC = UIActivityViewController(activityItems: [image], applicationActivities: nil)
if let presentationController = activityVC.presentationController as? UIPopoverPresentationController {
presentationController.sourceView = shareButton
}
present(activityVC, animated: true)
}