我有一个带文本字段和两个按钮的AlertController:CANCEL和SAVE.这是代码:
@IBAction func addTherapy(sender: AnyObject)
{
    let addAlertView = UIAlertController(title: "New Prescription", message: "Insert a name for this prescription", preferredStyle: UIAlertControllerStyle.Alert)
    addAlertView.addAction(UIAlertAction(title: "Cancel",
                                         style: UIAlertActionStyle.Default,
                                         handler: nil))
    addAlertView.addAction(UIAlertAction(title: "Save",
                                         style: UIAlertActionStyle.Default,
                                         handler: nil))
    addAlertView.addTextFieldWithConfigurationHandler({textField in textField.placeholder = "Title"})
    self.presentViewController(addAlertView, animated: true, completion: nil)
}
我想要做的是在文本字段为空时执行检查以禁用SAVE按钮,就像想要创建NewAlbum的iOS的图片应用程序一样.请有人能解释一下该怎么办?
看看我的下面的代码.我正在尝试使用uialertviewcontroller.Now添加文本字段当我的两个文本字段中没有输入时我需要禁用两个操作按钮.怎么做?
请提出一些可能的解决方案.谢谢!!