Set describe style to delete wallet button

pull/2/head
Michael Scoff 7 years ago
parent f27f735215
commit f347ca12ba
  1. 7
      Trust/Accounts/ViewControllers/AccountsViewController.swift
  2. 4
      Trust/Extensions/UIViewController.swift

@ -94,7 +94,12 @@ class AccountsViewController: UITableViewController {
} }
func confirmDelete(account: Account) { 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 { switch result {
case .success: case .success:
self.delete(account: account) self.delete(account: account)

@ -25,10 +25,12 @@ extension UIViewController {
func confirm( func confirm(
title: String? = .none, title: String? = .none,
message: String? = .none, message: String? = .none,
okTitle: String = NSLocalizedString("generic.Ok", value: "Ok", comment: ""),
okStyle: UIAlertActionStyle = .default,
completion: @escaping (Result<Void, ConfirmationError>) -> Void completion: @escaping (Result<Void, ConfirmationError>) -> Void
) { ) {
let alertController = UIAlertController(title: title, message: message, preferredStyle: .alert) 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()) completion(.success())
})) }))
alertController.addAction(UIAlertAction(title: NSLocalizedString("Generic.Cancel", comment: ""), style: .cancel, handler: { _ in alertController.addAction(UIAlertAction(title: NSLocalizedString("Generic.Cancel", comment: ""), style: .cancel, handler: { _ in

Loading…
Cancel
Save