// // UIViewController+Extensions.swift // Notes // // Created by Laurent Morvillier on 19/09/2022. // import Foundation import UIKit extension UIViewController { @objc public func showAlert(message: String, title: String?, completion: (() -> ())? = nil) { let alertController = UIAlertController(title: title, message: message, preferredStyle: .alert) let action = UIAlertAction(title: NSLocalizedString("OK", comment: "OK"), style: .default, handler: nil) alertController.addAction(action) self.present(alertController, animated: true, completion: completion) } }