diff --git a/Client/Frontend/Settings/ClearPrivateDataTableViewController.swift b/Client/Frontend/Settings/ClearPrivateDataTableViewController.swift index d67ef17fd59..a0538278bd3 100644 --- a/Client/Frontend/Settings/ClearPrivateDataTableViewController.swift +++ b/Client/Frontend/Settings/ClearPrivateDataTableViewController.swift @@ -201,6 +201,12 @@ class ClearPrivateDataTableViewController: UITableViewController { tableView.deselectRow(at: indexPath, animated: false) let actionSheet = UIAlertController(title: nil, message: nil, preferredStyle: .actionSheet) + if UIDevice.current.userInterfaceIdiom == .pad { + let cell = tableView.cellForRow(at: indexPath) + actionSheet.popoverPresentationController?.sourceView = cell + actionSheet.popoverPresentationController?.sourceRect = cell?.bounds ?? .zero + actionSheet.popoverPresentationController?.permittedArrowDirections = [.up, .down] + } let clearAction = UIAlertAction(title: Strings.ClearPrivateData, style: .destructive) { (_) in Preferences.Privacy.clearPrivateDataToggles.value = self.toggles self.clearButtonEnabled = false diff --git a/Client/Frontend/Sync/SyncSettingsTableViewController.swift b/Client/Frontend/Sync/SyncSettingsTableViewController.swift index 7943b30c7a5..4319a88eeec 100644 --- a/Client/Frontend/Sync/SyncSettingsTableViewController.swift +++ b/Client/Frontend/Sync/SyncSettingsTableViewController.swift @@ -108,7 +108,13 @@ class SyncSettingsTableViewController: UITableViewController { guard let frc = frc, let deviceCount = frc.fetchedObjects?.count else { return } let device = frc.object(at: indexPath) - let actionShet = UIAlertController(title: device.name, message: nil, preferredStyle: .actionSheet) + let actionSheet = UIAlertController(title: device.name, message: nil, preferredStyle: .actionSheet) + if UIDevice.current.userInterfaceIdiom == .pad { + let cell = tableView.cellForRow(at: indexPath) + actionSheet.popoverPresentationController?.sourceView = cell + actionSheet.popoverPresentationController?.sourceRect = cell?.bounds ?? .zero + actionSheet.popoverPresentationController?.permittedArrowDirections = [.up, .down] + } let removeAction = UIAlertAction(title: Strings.SyncRemoveDeviceAction, style: .destructive) { _ in if !DeviceInfo.hasConnectivity() { @@ -129,10 +135,10 @@ class SyncSettingsTableViewController: UITableViewController { let cancelAction = UIAlertAction(title: Strings.CancelButtonTitle, style: .cancel, handler: nil) - actionShet.addAction(removeAction) - actionShet.addAction(cancelAction) + actionSheet.addAction(removeAction) + actionSheet.addAction(cancelAction) - present(actionShet, animated: true) + present(actionSheet, animated: true) } private func presentAlertPopup(for type: DeviceRemovalType, device: Device) {