Answer the question
In order to leave comments, you need to log in
What is he swearing at?
Tell me what he doesn't like and how to fix it?
import UIKit
class Alert: NSObject {
static func show(title: String, message: String, vc: UIViewController) {
//Создание контроллера
let alertCT = UIAlertController(title: title, message: message, preferredStyle: UIAlertControllerStyle.Alert)
//Create Alert Action
let okAc = UIAlertAction(title: "Ok", style: UIAlertActionStyle.Default) { (alert:UIAlertAction) -> Void in alertCT.dismissViewControllerAnimated(true, completion: nil)}
//Add Alert Action to Alert Controller
alertCT.addAction(okAc)
//Display Alert Controller
vc.presentedViewController(alertCT, animated: true, completion: nil)
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question