|
@ -50,7 +50,7 @@ extension UIViewController { |
|
|
confirmAction() |
|
|
confirmAction() |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
let cancelAction = UIAlertAction(title: "Cancel", style: .cancel) { action -> Void in |
|
|
|
|
|
|
|
|
let cancelAction = UIAlertAction(title: "cancel_text".localized(), style: .cancel) { action -> Void in |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -60,20 +60,20 @@ extension UIViewController { |
|
|
self.present(deleteActionSheetController, animated: true, completion: nil) |
|
|
self.present(deleteActionSheetController, animated: true, completion: nil) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
func alert(message: String?, title: String? = "Alert!", okAction: (()->())? = nil) { |
|
|
|
|
|
|
|
|
func alert(message: String?, title: String? = "alert_text".localized(), okAction: (()->())? = nil) { |
|
|
let alertController = getAlert(message: message, title: title) |
|
|
let alertController = getAlert(message: message, title: title) |
|
|
alertController.addAction(title: "Ok", handler: okAction) |
|
|
|
|
|
|
|
|
alertController.addAction(title: "ok_text".localized(), handler: okAction) |
|
|
self.present(alertController, animated: true, completion: nil) |
|
|
self.present(alertController, animated: true, completion: nil) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
func alertWithOkCancel(message: String?, title: String? = "Error", okTitle: String? = "Ok", style: UIAlertControllerStyle? = .alert, cancelTitle: String? = "Cancel", OkStyle: UIAlertActionStyle = .default, cancelStyle: UIAlertActionStyle = .default, okAction: (()->())? = nil, cancelAction: (()->())? = nil) { |
|
|
|
|
|
|
|
|
func alertWithOkCancel(message: String?, title: String? = "Error", okTitle: String? = "ok_text".localized(), style: UIAlertControllerStyle? = .alert, cancelTitle: String? = "cancel_text".localized(), OkStyle: UIAlertActionStyle = .default, cancelStyle: UIAlertActionStyle = .default, okAction: (()->())? = nil, cancelAction: (()->())? = nil) { |
|
|
let alertController = getAlert(message: message, title: title, style: style) |
|
|
let alertController = getAlert(message: message, title: title, style: style) |
|
|
alertController.addAction(title: okTitle,style: OkStyle, handler: okAction) |
|
|
alertController.addAction(title: okTitle,style: OkStyle, handler: okAction) |
|
|
alertController.addAction(title: cancelTitle, style: cancelStyle, handler: cancelAction) |
|
|
alertController.addAction(title: cancelTitle, style: cancelStyle, handler: cancelAction) |
|
|
self.present(alertController, animated: true, completion: nil) |
|
|
self.present(alertController, animated: true, completion: nil) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
func alertWithOk(message: String?, title: String? = "Error", okTitle: String? = "Ok", style: UIAlertControllerStyle? = .alert, OkStyle: UIAlertActionStyle = .default, okAction: (()->())? = nil) { |
|
|
|
|
|
|
|
|
func alertWithOk(message: String?, title: String? = "Error", okTitle: String? = "ok_text".localized(), style: UIAlertControllerStyle? = .alert, OkStyle: UIAlertActionStyle = .default, okAction: (()->())? = nil) { |
|
|
let alertController = getAlert(message: message, title: title, style: style) |
|
|
let alertController = getAlert(message: message, title: title, style: style) |
|
|
alertController.addAction(title: okTitle,style: OkStyle, handler: okAction) |
|
|
alertController.addAction(title: okTitle,style: OkStyle, handler: okAction) |
|
|
self.present(alertController, animated: true, completion: nil) |
|
|
self.present(alertController, animated: true, completion: nil) |
|
|