From f347ca12ba2949f9e242b6d5b41e0ee18e96b6fc Mon Sep 17 00:00:00 2001 From: Michael Scoff Date: Sat, 21 Oct 2017 17:00:08 -0700 Subject: [PATCH] Set describe style to delete wallet button --- .../Accounts/ViewControllers/AccountsViewController.swift | 7 ++++++- Trust/Extensions/UIViewController.swift | 4 +++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Trust/Accounts/ViewControllers/AccountsViewController.swift b/Trust/Accounts/ViewControllers/AccountsViewController.swift index e8c20ba38..99e855de7 100644 --- a/Trust/Accounts/ViewControllers/AccountsViewController.swift +++ b/Trust/Accounts/ViewControllers/AccountsViewController.swift @@ -94,7 +94,12 @@ class AccountsViewController: UITableViewController { } func confirmDelete(account: Account) { - confirm(title: "Are you sure you would like to delete this wallet?", message: "Make sure you have backup of your wallet") { result in + confirm( + title: "Are you sure you would like to delete this wallet?", + message: "Make sure you have backup of your wallet", + okTitle: "Delete", + okStyle: .destructive + ) { result in switch result { case .success: self.delete(account: account) diff --git a/Trust/Extensions/UIViewController.swift b/Trust/Extensions/UIViewController.swift index fab5f4672..657d31373 100644 --- a/Trust/Extensions/UIViewController.swift +++ b/Trust/Extensions/UIViewController.swift @@ -25,10 +25,12 @@ extension UIViewController { func confirm( title: String? = .none, message: String? = .none, + okTitle: String = NSLocalizedString("generic.Ok", value: "Ok", comment: ""), + okStyle: UIAlertActionStyle = .default, completion: @escaping (Result) -> Void ) { let alertController = UIAlertController(title: title, message: message, preferredStyle: .alert) - alertController.addAction(UIAlertAction(title: "Ok", style: .default, handler: { _ in + alertController.addAction(UIAlertAction(title: okTitle, style: okStyle, handler: { _ in completion(.success()) })) alertController.addAction(UIAlertAction(title: NSLocalizedString("Generic.Cancel", comment: ""), style: .cancel, handler: { _ in