A
A
Aleksandr Govorukhin2016-02-28 17:14:49
iOS
Aleksandr Govorukhin, 2016-02-28 17:14:49

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)
    }

}

75ba313be060447d87959fc4d104853b.png

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question