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

This commit is contained in:
Roopesh Chander 2018-11-07 19:43:36 +05:30 committed by Jason A. Donenfeld
parent 2fd8792fa5
commit cc52c88321
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)
// 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))")
}

View File

@ -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)
}

View File

@ -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)
}