ios - textfiled is not empty when i return from log-out to log in screen [ SWIFT ] -
hope did work login , log out.but when try logout working fine.but when return login screen username/password remain there.
needed
how when logout or return login screen text field should empty.
here vc.swift
struct storyboard { static let showloginsegue = "sss" } @iboutlet weak var userfield: uitextfield! @iboutlet weak var passfield: uitextfield! override func viewdidload() { super.viewdidload() // additional setup after loading view, typically nib. self.userfield.delegate = self self.passfield.delegate = self } override func didreceivememorywarning() { super.didreceivememorywarning() // dispose of resources can recreated. } @ibaction func loginbut(sender: anyobject) { let klak = "" let qwqw = "" if userfield.text == klak && passfield.text == qwqw { print("correct") performseguewithidentifier(storyboard.showloginsegue, sender: nil) } else { print("wrong") }
}
thanks in advance !
add code vc.swift
override func viewwillappear(animated: bool) { userfield.text = "" passfield.text = "" }
try out & let me know !
Comments
Post a Comment