【发布时间】:2015-04-15 23:10:56
【问题描述】:
我完全不知道该怎么做。靠近了,但屏幕上什么也没有显示。当按下警报视图上的按钮时,我希望从警报控制器转到新视图。问题是我认为我没有标识符,因为我需要将它连接到用于玩游戏的按钮。所以我认为我最好的选择是让它以编程方式从警报控制器转移到没有标识符的下一个视图。有人知道这样做吗?
let alertController: UIAlertController = UIAlertController(title: "You Finished!", message: "Congratulations for finishing the game! Now all thats left is to email us so we can contact you.", preferredStyle: .Alert)
let nextAction = UIAlertAction(title: "Email", style: .Default) {
action -> Void in
let secondvc = EmailViewController (nibName: "EmailViewController", bundle: nil)
let navController = UINavigationController(rootViewController: secondvc)
self.presentViewController(EmailViewController(), animated: true, completion: nil)
}
alertController.addAction(nextAction)
self.presentViewController(alertController, animated: true, completion: nil)
}
}
【问题讨论】:
标签: ios swift segue uialertcontroller