2017-06-13 13:19:18 +08:00
|
|
|
//
|
|
|
|
|
// UtilsExtension.swift
|
|
|
|
|
// pass
|
|
|
|
|
//
|
|
|
|
|
// Created by Yishi Lin on 13/6/17.
|
|
|
|
|
// Copyright © 2017年 Bob Sun. All rights reserved.
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
import Foundation
|
|
|
|
|
import passKit
|
2020-06-28 21:25:40 +02:00
|
|
|
import SVProgressHUD
|
2017-06-13 13:19:18 +08:00
|
|
|
|
|
|
|
|
extension Utils {
|
|
|
|
|
static func alert(title: String, message: String, controller: UIViewController, handler: ((UIAlertAction) -> Void)? = nil, completion: (() -> Void)? = nil) {
|
|
|
|
|
SVProgressHUD.dismiss()
|
2019-05-01 17:49:27 +02:00
|
|
|
let alert = UIAlertController(title: title, message: message, preferredStyle: UIAlertController.Style.alert)
|
|
|
|
|
alert.addAction(UIAlertAction(title: "Ok".localize(), style: UIAlertAction.Style.default, handler: handler))
|
2017-06-13 13:19:18 +08:00
|
|
|
controller.present(alert, animated: true, completion: completion)
|
|
|
|
|
}
|
|
|
|
|
}
|