Search code examples
iosobjective-cuitextfielduistoryboardsegue

Keyboard doesn't hide when segue on UITextField


In storyboard I've connected from UITextField to another view. In my code I set a target for UITextField on UIControlEventEditingChanged. I also wrote some code in shouldPerformSegue and prepareForSegue.(only in some condition It can perform segue) My problem is that before performing segue, UITextField becomes first responder and shows keyboard when it goes to the new view controller. I have tried [self.view endEditing:YES] and resignFirstResponder for all textFields but it didn't change anything at all! Thanks for your help in advance!


Solution

  • Finally I solved the problem by placing a button on textField, whenever I want to perform segue, I disable textfield (if needed) and change view on button touch!