iPad: Ensure we set sourceRect for all cases where we use sourceView

Signed-off-by: Roopesh Chander <roop@roopc.net>
This commit is contained in:
Roopesh Chander 2018-11-07 19:43:36 +05:30 committed by Jason A. Donenfeld
parent b5447add1e
commit 85a19da487
3 changed files with 3 additions and 1 deletions

View File

@ -99,8 +99,8 @@ class SettingsTableViewController: UITableViewController {
let activityVC = UIActivityViewController(activityItems: [destinationURL], applicationActivities: nil) let activityVC = UIActivityViewController(activityItems: [destinationURL], applicationActivities: nil)
// popoverPresentationController shall be non-nil on the iPad // popoverPresentationController shall be non-nil on the iPad
activityVC.popoverPresentationController?.sourceView = sourceView activityVC.popoverPresentationController?.sourceView = sourceView
activityVC.popoverPresentationController?.sourceRect = sourceView.bounds
present(activityVC, animated: true) present(activityVC, animated: true)
} catch (let error) { } catch (let error) {
showErrorAlert(title: "Unable to export", message: "There was an error exporting the tunnel configuration archive: \(String(describing: error))") showErrorAlert(title: "Unable to export", message: "There was an error exporting the tunnel configuration archive: \(String(describing: error))")
} }

View File

@ -72,6 +72,7 @@ class TunnelDetailTableViewController: UITableViewController {
// popoverPresentationController will be nil on iPhone and non-nil on iPad // popoverPresentationController will be nil on iPhone and non-nil on iPad
alert.popoverPresentationController?.sourceView = sourceView alert.popoverPresentationController?.sourceView = sourceView
alert.popoverPresentationController?.sourceRect = sourceView.bounds
self.present(alert, animated: true, completion: nil) self.present(alert, animated: true, completion: nil)
} }

View File

@ -400,6 +400,7 @@ extension TunnelEditTableViewController {
// popoverPresentationController will be nil on iPhone and non-nil on iPad // popoverPresentationController will be nil on iPhone and non-nil on iPad
alert.popoverPresentationController?.sourceView = sourceView alert.popoverPresentationController?.sourceView = sourceView
alert.popoverPresentationController?.sourceRect = sourceView.bounds
self.present(alert, animated: true, completion: nil) self.present(alert, animated: true, completion: nil)
} }