12345678910111213141516171819202122 |
- //
- // TSCustomAlert+Ext.swift
- // AIEmoji
- //
- // Created by nkl on 2025/5/8.
- //
- import Foundation
- extension TSCustomAlertController {
- /// 确认弹窗
- public static func showAlert(on viewController: UIViewController, title: String?, message: String?, confirmTitle: String = "OK", confirmHandler: (() -> Void)? = nil) {
- let alert = UIAlertController(title: title, message: message, preferredStyle: .alert)
- let confirmAction = UIAlertAction(title: confirmTitle, style: .default) { _ in
- confirmHandler?()
- }
- alert.addAction(confirmAction)
- viewController.present(alert, animated: true, completion: nil)
- }
- }
|