如何在validation后closures警报视图?

我已经使用SCLAlertView用于forgot password在这个我已经放置了一个textfield SCLAlertViewinputemail ,使成功validation后只需要隐藏没有这个它不应该隐藏任何人都可以帮助我如何实现这一点?

我的代码如下所示

 @IBAction func forgetPasswordButton(_ sender: Any) { let appearance = SCLAlertView.SCLAppearance(showCloseButton: true) let alert = SCLAlertView(appearance: appearance) let txt = alert.addTextField("Enter your emailid") _ = alert.addButton("Submit", action: { let action = txt.text print(action as Any) }) if(txt.text?.isEmpty)! == true{ }else{ } _ = alert.showEdit("Forgot Password", subTitle:"Please enter your email address below.You will receive a link to reset your password",closeButtonTitle: "Cancel") } 

使用hideView()的属性并调用

 let action = txt.text print(action as Any) alert.hideView() }) 

为了更多的参考,你可以在这里得到样品