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
2
votes
0 answers
NSTextField in NSPopOver beeping instead of sending action to target (document)
I have a document-based Cocoa (Mac)/Objective-C application. I'm showing a popover on one of the views in my document window's view; the popover contains only an NSTextField, whose target is the first responder (I have also tried wiring it directly…

Peter Hosey
- 95,783
- 15
- 211
- 370
2
votes
1 answer
UIView hanging off edge of superview... tap events seen by *unrelated* underlying view
I've created a UIView (tooltip box) and added it as a subview of another view.
Using anchor constraints, I've floated it off the edge of its superview where it hovers above an unrelated UIView (which happens to be UITextView)
To the trespassing…

clearlight
- 12,255
- 11
- 57
- 75
2
votes
0 answers
SwiftUI TextField first responder not working when displaying a sheet having an other sheet as parent
Following the tons of explanations found on this Stackoverflow post, I have been able to make things work correctly (Xcode 12.5, iOS14) and I am grateful for your help.
One issue though: I am facing a scenario where a sheet has an other sheet as…

ydstmw
- 61
- 1
- 4
2
votes
1 answer
How can I fix buggy behavior in iOS 14 when the UIScrollView scrolls the first responder to view?
When I tap from one text field to another, it scrolls so that the previous text view is in focus. I've tried to respond to this by observing keyboard change notification and noticed that the UIResponder.keyboardWillChangeFrameNotification is getting…

B Roy Dawson
- 611
- 1
- 6
- 18
2
votes
0 answers
Is there a way to make the WKWebview a firstResponder?
The Main idea is to reload the WKWebView if there is no touches or presses detected (i.e When webView remains inactive for some timeinterval ) . I tried the way to implement
touchesBegan(_:with:) and
touchesEnded(_:with:)
I have overwritten those…

Muhmud Jafr
- 21
- 1
2
votes
2 answers
iPhone: dismiss keyboard when user touches background
I have read some other articles like here and here but unfortunately there are some differences in my code that won't make these work (so please don't suggest these answers).
I would like to dismiss the keyboard when the user taps the background.…

mtmurdock
- 12,756
- 21
- 65
- 108
2
votes
3 answers
motionBegan not being called in whole application
Hi all
I have an app where I allow the user to post something on their pinwall of facebook. I used the DemoApp directly from Facebook to set it up.
I have implemented a shake detection that does something when the user shakes the device. However,…

nimrod
- 5,595
- 29
- 85
- 149
2
votes
2 answers
Mac NSTextField won't resign firstResponder
I have a window with some NSTextFields. When I click in one and edit the value and press return, I want the focus to go back to what it was before. I don't want the blue ring around the text field and I don't want further keystrokes going to that…

bsabiston
- 721
- 6
- 22
2
votes
2 answers
resignFirstResponder to UITextViews on UITableViewCells that are no longer on screen
I have a UITableView with a whole bunch of custom UITableViewCells in it. Each of these UITableViewCells has a UITextView in them.
The problem I'm having, is that if the user touches a UITextView, that becomes the firstResponder and the keyboard…

user1072689
- 53
- 1
- 5
2
votes
2 answers
Keyboard does not disappear after viewDidDisappear
iOS 11.2, Xcode 9.2
I've tried all the ways to dismiss keyboard on viewDidDisappear of the old UIViewController AFTER a new UIViewController is pushed into UINavigationController stack. But with no luck.
If I dismiss it on viewWillDisappear - it…

iWheelBuy
- 5,470
- 2
- 37
- 71
2
votes
1 answer
First responder/focus after dismissing popover
I have a few UITextField inputs on a form screen where some of them have a numpad display that is shown via a custom popover. As the user advances through the fields, we close or open the popover as appropriate. In iOS 11, it seems the "first…

Michael
- 85
- 1
- 7
2
votes
0 answers
NSTextField without focus ring causes others to retain ring
I have an NSTableView, NSSearchField and an NSTextField. The NSTextField is configured to not have a focus ring. When I tab out of one other other controls, into the NSTextField, the focus ring remains on the previous control, even though the…

Trygve
- 1,317
- 10
- 27
2
votes
2 answers
Tracking the firstResponder object
I need to keep track of which text field is the firstResponder for my custom keyboard to work. In the code below, I have grossly oversimplified my program, but here is the gist of the problem:
@implementation SimplePickerViewController
@synthesize…

Harrison
- 21
- 3
2
votes
0 answers
Why is First Responder `nil` after startup?
Here is a minimal working example illustrating the issue: https://bitbucket.org/7331/firstrespondertest/.
What object is set as the First Responder of the keyWindow after the Single View Application starts up (suppose that I haven't interacted with…

sarasvati
- 792
- 12
- 30
2
votes
0 answers
Mac menu item grayed out even though first responder responds to the corresponding selector
I have a refresh item in my menu, bound to first responder's reload: method. I have two view controllers. Both DO implement the exact same method with the same signature:
-(void)reload:(id)sth{
...
}
The menu item is bound the following…

Can Poyrazoğlu
- 33,241
- 48
- 191
- 389