diff options
author | Roopesh Chander <roop@roopc.net> | 2018-11-07 19:43:36 +0530 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-11-07 17:43:30 +0100 |
commit | 85a19da487821aa1fe770900634a3a06b74ec851 (patch) | |
tree | 29f89ab2fad9b1aae42b87d80eb1cbacab6ff2d3 /WireGuard/WireGuard | |
parent | Info.plist: Register for handling public.text files for Open-in (diff) | |
download | wireguard-apple-85a19da487821aa1fe770900634a3a06b74ec851.tar.xz wireguard-apple-85a19da487821aa1fe770900634a3a06b74ec851.zip |
iPad: Ensure we set sourceRect for all cases where we use sourceView
Signed-off-by: Roopesh Chander <roop@roopc.net>
Diffstat (limited to '')
3 files changed, 3 insertions, 1 deletions
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) } |