SnapSh0t
@SnapSh0t
iOS-Developer

На что ругается?

Подскажите что ему не нравится и как исправить?

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
  • Вопрос задан
  • 142 просмотра
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы