我能够为我的按钮编写一个UIAlertController,它工作正常,但是当我按下YES或OK按钮时,我不知道如何切换到不同的页面.目前,YES或OK按钮无处可去.
@IBAction func SubmitButton(sender: AnyObject) { if a > 28.87 { var alert = UIAlertController(title: "H4 with Guide Pins",message: "Can it be removed?",preferredStyle: UIAlertControllerStyle.Alert) alert.addAction(UIAlertAction(title: "YES",style: UIAlertActionStyle.Default,handler: nil)) alert.addAction(UIAlertAction(title: "NO",handler: nil)) self.presentViewController(alert,animated: true,completion: nil) } else if data2.text == "" { var alert = UIAlertController(title: "Dimension",message: "Missing Data Input.",preferredStyle: UIAlertControllerStyle.Alert) alert.addAction(UIAlertAction(title: "OK",completion: nil) } else { var alert = UIAlertController(title: "H4 with Guide Pins",message: "Enter Swallow Dimension.",completion: nil) self.view.endEditing(true) } }