Reputation: 1303
Hy guys I am having problems with all UITextFields within my app that when it is as firstResponder and then I go to background and come back when I edit the characters alternatively shows/disappear.
I read some posts here on StackOverflow and people say that it is because before going to background state the UITextField was firstResponder and it should not be.
So the problem is that I can´t figure out how I would code to resignFirstResponder when user clicks the Home button.
Anyone could help?
Upvotes: 0
Views: 262
Reputation: 1303
I got it fixed by adding this code to AppDelegate:
func applicationWillResignActive(application: UIApplication) {
window?.endEditing(true)
}
Upvotes: 1