mirror of
https://github.com/mssun/passforios.git
synced 2026-02-27 18:24:03 +01:00
24 lines
855 B
Swift
24 lines
855 B
Swift
//
|
|
// UIAlertControllerExtension.swift
|
|
// passKit
|
|
//
|
|
// Copyright © 2021 Bob Sun. All rights reserved.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public extension UIAlertController {
|
|
class func removeConfirmationAlert(title: String, message: String, handler: ((UIAlertAction) -> Void)? = nil) -> UIAlertController {
|
|
let alert = UIAlertController(title: title, message: message, preferredStyle: .alert)
|
|
alert.addAction(UIAlertAction.remove(handler: handler))
|
|
alert.addAction(UIAlertAction.cancel())
|
|
return alert
|
|
}
|
|
|
|
class func showErrorAlert(title: String, message: String, completion: ((UIAlertAction) -> Void)? = nil) -> UIAlertController {
|
|
let alert = UIAlertController(title: title, message: message, preferredStyle: .alert)
|
|
alert.addAction(UIAlertAction.ok(handler: completion))
|
|
return alert
|
|
}
|
|
}
|