Questions tagged [responder-chain]

40 questions
1
vote
1 answer

Responder chain error

I want to translate this kind of Objective-C code to Swift: - (UINavigationController *)targetNaviCtrl{ if(!_targetNaviCtrl){ UIResponder *target = self.nextResponder; do { target = target.nextResponder; }…
dengApro
  • 3,145
  • 1
  • 22
  • 33
1
vote
1 answer

Is it good App design to use first responder instead of chaining methods down the controller hierarchy?

This question is for an OSX app, but the same principle can be for iOS. I have a NSWindowController on storyboard with the following setup. A. MainWindowController has as subviews: 1) A toolbar with a button 2) A SubVcA viewController with its own…
Just a coder
  • 10,809
  • 12
  • 70
  • 112
1
vote
2 answers

mouseDragged: is not passed down two subviews?

I am writing a program that has a number of subclassed NSViews (Frame) with varying contents that can be dragged around by the mouse in their superview. All of the views contain one subview, called contentView, which in turn can contain a more…
0
votes
1 answer

tryToPerform:with: not being called when keyDown: is being called

I have a NSViewController which I manually put into the responder-chain by calling self.nextResponder = self.view.nextResponder; self.view.nextResponder = self; When the user presses keys inside the view, I am able to successfully receive keyDown:…
Tony
  • 30,345
  • 9
  • 45
  • 77
0
votes
1 answer

Using the responder chain to see when a subview is added

It there any way for a window to tell that a subview's subview has been added. It seems like there is architecture in place (in the form of the responder chain) to allow a kind of event bubbling up the view hierachy, but this only seems to exist to…
Undistraction
  • 38,727
  • 46
  • 165
  • 296
0
votes
1 answer

Why doesn't my UILabel in a nested view receive touch events / How can I test the Responder Chain?

I have found lots of similar questions about not receiving touch events and I understand that in some cases, writing a custom hitTest function may be required - but I also read that the responder chain will traverse views and viewControllers that…
0
votes
0 answers

What is the proper design pattern for handling keyDown: events in a NSSplitView?

I would like to have separate KeyDown: handlers for each of the various subviews in a complex splitview based Window. In addition, I would like to have a "global" KeyDown: handler at the WindowController level for any keys that are not handled by…
0
votes
2 answers

IBAction does not fire when I add viewDidLoad

I have several IBActions attached to UIButtons. The IBActions work fine until I add the following code: - (void)viewDidLoad { [super viewDidLoad]; NSLog(@"View Did Load"); [self addGestureRecognizersToView:drawImage]; } After I add…
AaronG
  • 522
  • 1
  • 7
  • 18
0
votes
0 answers

How to make a custom NSView IBActions callable from menu items?

I have a NSViewController that adds a custom NSView as a subview to the view controllers view. I would like to make the IBAction-methods of that custom view callable thru the First Responder object but the menu items that are wired to the…
Melodius
  • 1,697
  • 1
  • 15
  • 29
0
votes
1 answer

iOS: How to implement the mask view event penetrate?

As the following image,I have a collectionView, with a maskView above it. And a right side view above the maskView. How to implement the mask view event penetrate? My PM's idea is that the collectionViewCell is clickable when a mask view above the…
dengST30
  • 1,898
  • 10
  • 19
0
votes
1 answer

UIButton do not respond to touch event

I have a UIButton not responding to touch event. And the button only has some subviews not handling events. So I replaced it with my customized UIButton to find out what happened. Below is my code: @interface CustomButton :…
Neal.Marlin
  • 435
  • 2
  • 16
0
votes
1 answer

How can I Invoke tableview cell click event out of tableview frame?

Is there a way when I touch the point which out of tableview frame,invoke tableview delegate function -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath? I've tried override superview of tableview's -(UIView…
cs Kim
  • 1
0
votes
1 answer

NSWindow loses first responder after dismissing NSPopover

I have a window that presents a popover with a bunch of text fields. I want these text fields to be tabbable but not focused when the popover appears. To achieve this I set the first responder to nil when the popover appears: // Inside popover's…
Ian Bytchek
  • 7,964
  • 5
  • 37
  • 67
0
votes
1 answer

NSApp.sendAction() only works after some time

I want a ViewController (ContainerVC) to react on clicks on child custom views (ChildView). In ChildView I override mouseDown(_:) to handle the click. In this method I try to call the ContainerVC target via…
mic
  • 877
  • 6
  • 16
0
votes
1 answer

Why should -[NSTextInputClient doCommandBySelector:] not pass the event up the responder chain?

A text view should not forward uninvokable commands up the responder chain, the docs say for -[NSTextInputClient doCommandBySelector:]: If aSelector cannot be invoked, then doCommandBySelector: should not pass this message up the responder chain.…
ctietze
  • 2,459
  • 20
  • 40