验证后如何解除警报视图?

时间:2017-07-07 07:20:43

标签: ios swift3 uialertview

我曾使用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")
    }

1 个答案:

答案 0 :(得分:0)

使用hideView()的属性并调用

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

如需更多参考,您可以获得示例here