Fix crash when sharing large image on iPad
This commit is contained in:
parent
803ba50f53
commit
c0316f55ef
|
@ -227,6 +227,9 @@ class LargeImageViewController: UIViewController, UIScrollViewDelegate, LargeIma
|
||||||
@IBAction func sharePressed(_ sender: Any) {
|
@IBAction func sharePressed(_ sender: Any) {
|
||||||
guard let image = image else { return }
|
guard let image = image else { return }
|
||||||
let activityVC = UIActivityViewController(activityItems: [image], applicationActivities: nil)
|
let activityVC = UIActivityViewController(activityItems: [image], applicationActivities: nil)
|
||||||
|
if let presentationController = activityVC.presentationController as? UIPopoverPresentationController {
|
||||||
|
presentationController.sourceView = shareButton
|
||||||
|
}
|
||||||
present(activityVC, animated: true)
|
present(activityVC, animated: true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue