错误:转换到其他视图时的UIAlertController

时间:2016-04-07 02:38:25

标签: ios uialertcontroller

当我将函数转换添加到名为“Result”的其他视图时,对于UIAlertController的对象,它转换为黑色视图,我无法在其中执行任何操作。帮我解决一下。

var controller : UIAlertController?

@IBAction func next() {
   controller = UIAlertController(title: "Warning:", message: "Are you sure ?", preferredStyle: .Alert)

   let action = UIAlertAction(title: "Sure!", style: UIAlertActionStyle.Default, handler:{(paramAction: UIAlertAction!) in self.transition()})
   controller?.addAction(action)
   self.presentViewController(controller!, animated: true, completion: nil)
}

func transition() {
    let secondViewController:Result = Result()
    self.presentViewController(secondViewController, animated: true, completion: nil)
}

0 个答案:

没有答案