In Apple Cocoa programing, the first responder is the first object in a chain of NSResponder subclasses to be called upon receiving an even such as keypress, mouseclick, etc.
Questions tagged [first-responder]
409 questions
20
votes
6 answers
Why is UIKeyboardWillShowNotification called every time another TextField is selected?
I have a project that contains a UIScrollView and many UITextField inside it.
For the first time I select a UITextField, UIKeyboardWillShowNotification is called, which is fine. But whenever I select new UITextField (THE KEYBOARD IS STILL THERE),…

onmyway133
- 45,645
- 31
- 257
- 263
19
votes
10 answers
How to move to next TextField in SwiftUI?
Using Swift5.1.2, iOS13.2, Xcode-11.2,
Having several TextFields in a Stackview, I would like to move to the next TextField as soon as the user types x-amount of characters into the first TextField.
With this link, I achieve to recognise when a…

iKK
- 6,394
- 10
- 58
- 131
19
votes
4 answers
Can't type text into UITextField or UITextView in iOS6
In one of my apps, when I try to edit (type some text) UITextField, UITextView or any other 'text-able' UIControl the cursor just blinks but no characters are typed in except BACKSPACE (possible only when I have some initial text in it), RETURN and…

Lukasz
- 19,816
- 17
- 83
- 139
16
votes
2 answers
How can "First Responder" be used in a xib file?
i read about responder chains, and basically i read about how the events from the UI are passed up on the responder chain, how to handle them and how to pass along. I also used -becomeFirstResponder and -resignFirstResponder, but i was using these…

Moszi
- 3,236
- 2
- 22
- 20
15
votes
1 answer
Does a UITextField with first responder status in a UITableViewCell prevent cell re-use?
In a UITableView where the cells contain UITextField objects, does having one of those UITextField objects be the first responder prevent its cell from being re-used?
For example, with a UITableView that has more rows than will fit on the screen,…

GBegen
- 6,107
- 3
- 31
- 52
15
votes
4 answers
How to activate next UITextField in a UITableView?
I am using this other SO answer for adding UITextFields to my UITableViewCells. However, I am now at a loss how I can let the user focus on the next item by using the next button. Any hints?

Arne
- 2,624
- 3
- 24
- 45
15
votes
3 answers
UIKeyCommands don't work when intermediary viewController contains two viewControllers
I believe this is a non-trivial problem related to UIKeyCommands, hierarchy of ViewControllers and/or responders.
In my iOS 9.2 app I have a class named NiceViewController that defines UIKeyCommand that results in printing something to the…

mgamer
- 13,580
- 25
- 87
- 145
13
votes
2 answers
UISearchBar and resignFirstResponder
I have a very basic UITableView with an attached UISearchBar, and here's the flow of what happens
UITableView is empty, user taps UISearchBar, and brings up keyboard.
Once the user taps the Search button
-…

Bryan Clark
- 203
- 1
- 2
- 10
13
votes
2 answers
Custom inputView for UITextField , how do I direct input back to the text field?
I have set a custom inputView to my UITextField. I need a way to display the data selected in my custom inputView in the UITextfield. I would like to achieve this the same way the system keyboard does it.
Does anyone know how this is done? How does…

Darren Findlay
- 2,533
- 2
- 29
- 46
11
votes
5 answers
UIWebView with contentEditable (html editing), first responder handling?
I'm making an html editor component for an app (using UIWebView with contentEditable in iOS 5.0), and got stuck at how to handle UIWebView first responder status
[webView isFirstResponder], [webView becomeFirstResponder] and [webView…

Ismael
- 3,927
- 3
- 15
- 23
11
votes
2 answers
SwiftUI - Making a View focusable and trigger an action on macOS
How is it possible to make a View on macOS focusable. I tried the it like below but the action is never triggered. I know that for NSView you have to implement acceptsFirstResponder to return true but can not find similar in SwiftUI.
Is this still a…

Marc T.
- 5,090
- 1
- 23
- 40
11
votes
6 answers
presenting a modal view controller while the keyboard is active
So I basically have a form, consisting of several text fields. The user types into the fields as usual. But the user also has the option of double-tapping a text field, which presents a modal view controller, allowing the user to choose from a…

DanM
- 7,037
- 11
- 51
- 86
11
votes
4 answers
Change UITextField background when editing begins
I'd like to change the background image of a UITextField when it becomes the firstResponder to show the user that it has focus, similar to the :active or :focus pseudo-classes in CSS.
I'm guessing that I may need to do this programmatically; so any…

Giles Van Gruisen
- 961
- 3
- 13
- 27
10
votes
5 answers
Can I override scroll view's automatic behavior to scroll to the first responder?
I have a UITextField inside a UIScrollView (a few levels deep). I am watching UIKeyboardDidShowNotification, and also calling the same code when I manually change the first responder (I might change to a different text field without momentarily…

morningstar
- 8,952
- 6
- 31
- 42
10
votes
2 answers
iPhone first responders
I am confused about the iPhone responder chain. Specifically, in the iPhone event handling guide http://developer.apple.com/iPhone/library/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/EventHandling/EventHandling.html, we have the…

William Jockusch
- 26,513
- 49
- 182
- 323