все, что я делаю Alert от моего AlertController, но я хочу, чтобы после нажатия кнопки «ОК» нажата, откройте LoginController, как я могу это сделать? Я пытался это сделать так же, как ниже, но это не работаетswift 3 make alert с кнопкой действия и текущим контроллером
AlertController:
class AlertController: NSObject {
class func showErrorWith(title:String? = nil, message:String? = nil, controller: UIViewController , complition:(() ->())?){
let alert = UIAlertController(title: title, message: message, preferredStyle: .alert)
alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { (action) in
// let storyboard = UIStoryboard(name: "Main", bundle: nil)
// let viewController = storyboard.instantiateViewController(withIdentifier :"LoginVC")
// self.present(viewController, animated: true)
//
}))
controller.present(alert, animated: true, completion: nil)
}
вам нужно переместить настоящий Кодекс в части Содержащаяся. –