アラートを表示する
swift
SimpleAlert.showAlert(viewController: self, title: "タイトル", message: "内容を描いてください", buttonTitle: "OK")
アラート表示
swift
import UIKit
struct SimpleAlert {
static func showAlert(viewController: UIViewController, title: String, message: String, buttonTitle: String) {
let alert = UIAlertController(title: title, message: message, preferredStyle: .alert)
let okAction = UIAlertAction(title: buttonTitle, style: .default) { (action) in
alert.dismiss(animated: true, completion: nil)
}
alert.addAction(okAction)
viewController.present(alert, animated: true, completion: nil)
}
}