2017-07-07 67 views
0

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

回答

0

使用屬性的hideView()並呼籲像

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

更多的參考,你可以得到樣品here

+0

未經驗證它不應該隱瞞我需要 –

+0

@Thiru - 赦免 –

+0

我得到了謝謝bro @ Anbu.Karthik –