Modal在Swift中弹出3

问题描述:

我想用swift实现弹出式模式。我必须实现这样的功能,以便根据用户点击的响应(是/否)再弹出一个窗口。如何实现这个 ? 任何帮助将非常有帮助。Modal在Swift中弹出3

+0

检查这个库可以帮助它https://github.com/MarioIannotta/MIBlurPopup –

UIAlertController专为此目的而设计。

 let alertController = UIAlertController(title: "Default AlertController", message: "A standard alert", preferredStyle: .Alert) 

     let cancelAction = UIAlertAction(title: "No", style: .Cancel) { (action:UIAlertAction!) in 
      println("you have pressed the No button"); 
      //Call another alert here 
     } 
     alertController.addAction(cancelAction) 

     let OKAction = UIAlertAction(title: "Yes", style: .Default) { (action:UIAlertAction!) in 
      println("you have pressed Yes button"); 
      //Call another alert here 
     } 
     alertController.addAction(OKAction) 

     self.presentViewController(alertController, animated: true, completion:nil) 
+0

我知道这个报告控制,但情况是我必须做出一个自定义模式弹出,我怎么能实现定制弹出? – victorious

+1

简单的做法是,将UIView放入透明背景。在其上添加一个视图,用作弹出窗口。现在开始设计UIView。 –

+0

好的,这似乎是一个更好的方法。我一定会实现。谢谢:) – victorious