diff options
| author | Jon Petersson <jon.petersson@kvadrat.se> | 2023-05-22 13:25:38 +0200 |
|---|---|---|
| committer | Jon Petersson <jon.petersson@kvadrat.se> | 2023-06-08 16:36:40 +0200 |
| commit | e4677b9fe4b22bfbdb9140507ad6222feddf6b9d (patch) | |
| tree | 533abd51cf76d60786ef4f9130d47d271707d6fd /ios/MullvadVPN/View controllers/ProblemReport | |
| parent | 04e49a9f00467a35138ba12d4c812397797ff1ce (diff) | |
| download | mullvadvpn-e4677b9fe4b22bfbdb9140507ad6222feddf6b9d.tar.xz mullvadvpn-e4677b9fe4b22bfbdb9140507ad6222feddf6b9d.zip | |
Create custom alert dialogs
Diffstat (limited to 'ios/MullvadVPN/View controllers/ProblemReport')
| -rw-r--r-- | ios/MullvadVPN/View controllers/ProblemReport/ProblemReportViewController.swift | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/ios/MullvadVPN/View controllers/ProblemReport/ProblemReportViewController.swift b/ios/MullvadVPN/View controllers/ProblemReport/ProblemReportViewController.swift index b1deac8f5f..530dfa35d6 100644 --- a/ios/MullvadVPN/View controllers/ProblemReport/ProblemReportViewController.swift +++ b/ios/MullvadVPN/View controllers/ProblemReport/ProblemReportViewController.swift @@ -508,37 +508,36 @@ final class ProblemReportViewController: UIViewController, UITextFieldDelegate { comment: "" ) - let alertController = UIAlertController( - title: nil, + let alertController = CustomAlertViewController( message: message, - preferredStyle: .alert + icon: .alert ) - let cancelAction = UIAlertAction( + alertController.addAction( title: NSLocalizedString( - "EMPTY_EMAIL_ALERT_CANCEL_ACTION", + "EMPTY_EMAIL_ALERT_SEND_ANYWAY_ACTION", tableName: "ProblemReport", - value: "Cancel", + value: "Send anyway", comment: "" ), - style: .cancel - ) { _ in - completion(false) - } - let sendAction = UIAlertAction( + style: .destructive, + handler: { + completion(true) + } + ) + + alertController.addAction( title: NSLocalizedString( - "EMPTY_EMAIL_ALERT_SEND_ANYWAY_ACTION", + "EMPTY_EMAIL_ALERT_CANCEL_ACTION", tableName: "ProblemReport", - value: "Send anyway", + value: "Cancel", comment: "" ), - style: .destructive - ) { _ in - completion(true) - } - - alertController.addAction(cancelAction) - alertController.addAction(sendAction) + style: .default, + handler: { + completion(false) + } + ) present(alertController, animated: true) } |
