passforios/pass/Helpers/UtilsExtension.swift

21 lines
717 B
Swift
Raw Normal View History

//
// UtilsExtension.swift
// pass
//
// Created by Yishi Lin on 13/6/17.
// Copyright © 2017 Bob Sun. All rights reserved.
//
import Foundation
import SVProgressHUD
import passKit
extension Utils {
static func alert(title: String, message: String, controller: UIViewController, handler: ((UIAlertAction) -> Void)? = nil, completion: (() -> Void)? = nil) {
SVProgressHUD.dismiss()
let alert = UIAlertController(title: title, message: message, preferredStyle: UIAlertControllerStyle.alert)
2019-01-14 20:57:45 +01:00
alert.addAction(UIAlertAction(title: "Ok".localize(), style: UIAlertActionStyle.default, handler: handler))
controller.present(alert, animated: true, completion: completion)
}
}