diff --git a/WireGuard/WireGuard/UI/iOS/SettingsTableViewController.swift b/WireGuard/WireGuard/UI/iOS/SettingsTableViewController.swift index 5374b40..fac2005 100644 --- a/WireGuard/WireGuard/UI/iOS/SettingsTableViewController.swift +++ b/WireGuard/WireGuard/UI/iOS/SettingsTableViewController.swift @@ -99,8 +99,8 @@ class SettingsTableViewController: UITableViewController { let activityVC = UIActivityViewController(activityItems: [destinationURL], applicationActivities: nil) // popoverPresentationController shall be non-nil on the iPad activityVC.popoverPresentationController?.sourceView = sourceView + activityVC.popoverPresentationController?.sourceRect = sourceView.bounds present(activityVC, animated: true) - } catch (let error) { showErrorAlert(title: "Unable to export", message: "There was an error exporting the tunnel configuration archive: \(String(describing: error))") } diff --git a/WireGuard/WireGuard/UI/iOS/TunnelDetailTableViewController.swift b/WireGuard/WireGuard/UI/iOS/TunnelDetailTableViewController.swift index 9bd9f5a..3e30662 100644 --- a/WireGuard/WireGuard/UI/iOS/TunnelDetailTableViewController.swift +++ b/WireGuard/WireGuard/UI/iOS/TunnelDetailTableViewController.swift @@ -72,6 +72,7 @@ class TunnelDetailTableViewController: UITableViewController { // popoverPresentationController will be nil on iPhone and non-nil on iPad alert.popoverPresentationController?.sourceView = sourceView + alert.popoverPresentationController?.sourceRect = sourceView.bounds self.present(alert, animated: true, completion: nil) } diff --git a/WireGuard/WireGuard/UI/iOS/TunnelEditTableViewController.swift b/WireGuard/WireGuard/UI/iOS/TunnelEditTableViewController.swift index 40d86e9..3af97da 100644 --- a/WireGuard/WireGuard/UI/iOS/TunnelEditTableViewController.swift +++ b/WireGuard/WireGuard/UI/iOS/TunnelEditTableViewController.swift @@ -400,6 +400,7 @@ extension TunnelEditTableViewController { // popoverPresentationController will be nil on iPhone and non-nil on iPad alert.popoverPresentationController?.sourceView = sourceView + alert.popoverPresentationController?.sourceRect = sourceView.bounds self.present(alert, animated: true, completion: nil) }