验证后如何关闭警报视图?

how to dismiss alert view after validation?

我使用了SCLAlertView 用于forgot password 在这里我放置了一个textfield 来输入email 这样在成功验证后只需要隐藏而不用这不应该隐藏任何人都可以帮助我如何实现它吗?

我的代码如下所示

@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() 
    })

有关更多参考,您可以获取示例 here