Questions tagged [uiresponder]

The UIResponder class defines an interface for objects that respond to and handle events. It is the superclass of UIApplication, UIView and its subclasses (which include UIWindow). Instances of these classes are sometimes referred to as responder objects or, simply, responders.

The UIResponder class defines an interface for objects that respond to and handle events. It is the superclass of UIApplication, UIView and its subclasses (which include UIWindow). Instances of these classes are sometimes referred to as responder objects or, simply, responders.

There are two general kinds of events: touch events and motion events. The primary event-handling methods for touches are touchesBegan:withEvent:, touchesMoved:withEvent:, touchesEnded:withEvent:, and touchesCancelled:withEvent:. The parameters of these methods associate touches with their events—especially touches that are new or have changed—and thus allow responder objects to track and handle the touches as the delivered events progress through the phases of a multi-touch sequence. Any time a finger touches the screen, is dragged on the screen, or lifts from the screen, a UIEvent object is generated. The event object contains UITouch objects for all fingers on the screen or just lifted from it.

iOS 3.0 introduced system capabilities for generating motion events, specifically the motion of shaking the device. The event-handling methods for these kinds of events are motionBegan:withEvent:, motionEnded:withEvent:, and motionCancelled:withEvent:. Additionally for iOS 3.0, the canPerformAction:withSender: method allows responders to validate commands in the user interface while the undoManager property returns the nearest NSUndoManager object in the responder chain.

In iOS 4.0, UIResponder added the remoteControlReceivedWithEvent: method for handling remote-control events.

259 questions
1
vote
1 answer

'resignFirstResponder()' returns true and the text field loses focus but the keyboard does not dismiss

I have a storyboard scene that only has two UITextField.The first one is left untouched, fresh out of the object library. The second one has its delegate outlet connected to the ViewController's code. App's interface The second text field's…
1
vote
2 answers

Notifying view controller when subview touch events occur

I have a UIViewController whose view has a custom subview. This custom subview needs to track touch events and report swipe gestures. Currently I put touchesBegan, touchesMoved, touchesEnded and touchesCancelled in the subview class. With some…
nebs
  • 4,939
  • 9
  • 41
  • 70
1
vote
2 answers

If child button is disabled then stop passing event to parent

I have a UIButton on UITableViewCell and if I set button.enabled = false; ...then subsequent clicks on that button triggers click on UITableViewCell. So if button is disabled then how to make sure click on it won't trigger table cell click?
Praful Kadam
  • 372
  • 6
  • 22
1
vote
1 answer

Passing touches from UIImageView to superview

I have four UIImageViews placed on a circular UIView. Dragging the UIView rotates the view. But when I drag the UIImageView, the rotation does not occur. The UIImageView is eating the touches. I subclassed the UIImageView and tried this: - (void)…
Anil
  • 2,430
  • 3
  • 37
  • 55
1
vote
1 answer

touchesEnded:withEvent: not detecting the top node in SpriteKit

I have a custom class Object derived from SKSpriteNode with an SKLabelNode member variable. #import @interface Object : SKSpriteNode { SKLabelNode* n; } @end In the implementation, I set up the SKLabelNode. #import…
aanrv
  • 2,159
  • 5
  • 25
  • 37
1
vote
1 answer

UITextField clear glitch - text highlights, selection carets appear

I'm seeing a glitch in a UITextField when you tap on the clear button (the little X). Immediately before the text disappears, the selection carets appear (the vertical lines you move to select text) and then the text highlights as if it were…
Anna Dickinson
  • 3,307
  • 24
  • 43
1
vote
1 answer

forward UIGestures from subview to superview

I have this view hierarchy: the green UIView contains some buttons. the blue UIView is a horizontal UIScrollView. the problem is here when I swipe on the green view, it captures the swipe and waste it! How can i forward the gestures from greenView…
1
vote
2 answers

ContentInsets doesn't work for UITableView

I have a text box in a TableView and when the user selects a switch it appears ( becomes visible) and a keyboard pops up, and when the user turns off the switch the TextBox disappears and keyboard hides. During the time when the keyboard appears and…
vishal dharankar
  • 7,536
  • 7
  • 57
  • 93
1
vote
1 answer

Touch event forwarding in iOS

I have a UI component that I want to display in my app, in such a way that any touch event at all dismisses it (though touching the component itself would yield a different result that touching outside of it). My current solution is to have a…
Mason
  • 6,893
  • 15
  • 71
  • 115
1
vote
1 answer

Can non View class become a FirstResponder?

I have a custom class (MyEventHandler) which has nothing to do with the UI in my app. I would like it to be able to catch a MotionShake event. As I understand I need to make MyEventHandler a first responder for that. Here's what I've done. I…
oranJess
  • 588
  • 1
  • 5
  • 17
1
vote
0 answers

Sending nearby taps to a UICollectionViewCell

I have a UICollectionView where cells are text sized so the whole thing may end up being only about 13 or 30pt tall, depending. Needless to say, the cells are really hard to tap. To solve this problem, I'm trying to send nearby tap events into the…
Brian Nickel
  • 26,890
  • 5
  • 80
  • 110
1
vote
2 answers

dismisViewController leaks viewcontrollers when first responder set

In my simple navigation style iPhone app, when the user presses a button I am presenting a view controller V1 (modally) using presentViewController. When the user presses another button this then presents another view controller V2 (modally) using…
Scotty
  • 2,019
  • 1
  • 20
  • 31
1
vote
2 answers

Can a OpenGL game engine create it's own UIResponder subclass similar to Sprite Kit does for SKNode?

It looks like UIResponder is interwoven with UIView. Yet, Sprite Kit has the SKNode class which inherits from UIResponder so it can handle touch events. If you create a node-based game engine yourself: Can you create your own UIResponder subclass so…
openfrog
  • 40,201
  • 65
  • 225
  • 373
1
vote
1 answer

iOS Data structure to maintain multi touch traces?

Im trying to enable multitouch gesture recognition for my application. I have been trying to maintain a data structure that would maintain touch traces (all the points in the life time of a touch from start to move to end) for multiple fingers. It…
Sagar
  • 555
  • 9
  • 24
1
vote
1 answer

iOS Private API performSelector crash

Basically I want to get a list of action targets for a UIButton. I have gone through this and my question is slightly different because I do not know what the target is. All I have is a UIButton object. So here's what I did to capture all action…
TorukMakto
  • 2,066
  • 2
  • 24
  • 38