Questions tagged [resignfirstresponder]

A UIResponder method added for handling remote-control events. for iOS 4 and iOS4+

When the user taps a control that can accept first responder status, that control is sent the becomeFirstResponder message. Until another control becomes the first responder or the current control is sent the resignFirstResponder message, that control will keep this status and receive keyboard and shake input.

170 questions
6
votes
3 answers

Understanding resignFirstResponder with UITextField

I'm trying to get rid of the keyboard when the user touch outside my UITextField, by using this method: - (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { [mainTextController resignFirstResponder]; [super…
Lior Pollak
  • 3,362
  • 5
  • 27
  • 48
5
votes
5 answers

resignFirstResponder Don't work?

I try to hide keyboard on iPad but I don't know why resignFirstResponder don't work. But popToRoot has work well. - (BOOL)textFieldShouldReturn:(UITextField *)textField { NSString *desc = [NSString stringWithFormat:@"%@",[descTF text]]; …
crazyoxygen
  • 706
  • 1
  • 11
  • 30
5
votes
2 answers

textview keyboard not resigning when i press done iOS

i have a textview and when i press done the textview starts a new line. I have implemented these methods and added all the delegates @property (nonatomic, strong) IBOutlet UITextView *textField; -(void)textViewDidEndEditing:(UITextView *)textView…
5
votes
2 answers

how to resignFirstResponder from view controller

How to resignFirstResponder from uiviewcontroller object with is active. I have five textfields one,two,three,four,five. - (void)removeKeyBoard{ [one resignFirstResponder]; [two resignFirstResponder]; [three resignFirstResponder]; …
kiran
  • 4,285
  • 7
  • 53
  • 98
5
votes
0 answers

UIKeyboardWillHideNotification called in rotation

I had implemented this: [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil]; [[NSNotificationCenter defaultCenter]addObserver:self…
5
votes
1 answer

UIKeyboard next button not going to next UITextField

I have been trying to figure out how to get the next button on the UIKeyboard to load the next UITextField.. I have two cells, Name and Email I would like to go from Name to Email using the Next button. so far I have added //.h …
HurkNburkS
  • 5,492
  • 19
  • 100
  • 183
4
votes
0 answers

prevent inputAccessoryView from displaying when presenting viewController

I have a viewController with an inputAccessoryView that is displayed as below: override var inputAccessoryView: UIView? { get { return myInputView } } override var canBecomeFirstResponder: Bool { return true } I can easily show and…
alionthego
  • 8,508
  • 9
  • 52
  • 125
4
votes
2 answers

textField resignFirstResponder disappears UITableView header

I have a UITextField inside a UIView which is used as the tableHeaderView of a UITableView. When I call resignFirstResponder for the textField in order to dismiss the keyboard, the whole tableHeaderView vanishes. Same happens when I try to reload…
giorgos.nl
  • 2,704
  • 27
  • 36
4
votes
1 answer

IQKeyboardManager hides keyboard when tapped on UITextField

I have two text fields. I am using this code in textFieldDidBeginEditing, but it's not dismissing the keyboard. -(void)textFieldDidBeginEditing:(UITextField *)textField { if(textField==textFieldOne) { } else if…
4
votes
1 answer

How To Resign The UITextView With Done Button

i was wondering if any of you knew how to get access to that done button that appears above the keyboard when editing. I have seen it before, above the keyboard there is a transparent black area and on the right there is a blue "Done" Button. I…
Necro
  • 333
  • 5
  • 18
3
votes
2 answers

UISearchBar won't hide keyboard on resignFirstResponder when moving to another view controller

I have a UISearchBar that behaves normally - the keyboard goes away if I hit "Search" or "Cancel". However, when I push a new view controller on my navigation stack, if the keyboard is open, it won't close. It stays there in the old view…
alex_c
  • 2,058
  • 2
  • 26
  • 34
3
votes
3 answers

Why have to call resignFirstResponder() asynchronously on the main queue to dismiss the keyboard

I use a UISearchBar to filter data for a table view and I want the keyboard dismissed when the search bar has no query text (text is removed by tapping the keyboard deleting button or tapping the searchbar clear button). Based on what I've learned…
marcel
  • 77
  • 1
  • 4
  • 16
3
votes
0 answers

Why changing the focus programatically on secured text box lets last character appear

Lets say I have a secured textfield and I am trying to change the focus to some other textfield on UIControlEventEditingChanged by calling BecomeFirstResponder or ResignFirstResponder then the last character is still visible I am changing the focus…
3
votes
2 answers

Swift: Can't get UITextField to dismiss keyboard

I have two textFields and a Done button in my VC but I'm having some problems with the ending of editing. My textFieldDidEndEditing method is called when I tap on one textField after being inside the other one, or when I tap outside the textField…
Jonathan Tuzman
  • 11,568
  • 18
  • 69
  • 129
3
votes
2 answers

iOS UITextField resignFirstResponder on viewWillDisappear

I have an application with two simple screen. The first screen always opens same instance of the second screen. The second screen has a text field and a button to manually hide keyboard. The resignFirstResponder on viewWillDisappear is not…
fthdgn
  • 1,339
  • 1
  • 13
  • 18
1
2
3
11 12