问题
I had used SCLAlertView
used for forgot password
in this i had placed a textfield
to enter email
so that after making successful validation only it need to hide without this it should not hide can anyone help me how to implement this ?
My code is shown below
@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:
use the property of hideView()
and call like
let action = txt.text
print(action as Any)
alert.hideView()
})
for more reference you can get the sample here
来源:https://stackoverflow.com/questions/44964838/how-to-dismiss-alert-view-after-validation