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
0
votes
0 answers

responder chain issue of UIViewController

I find that if a UIViewController is not in the hierarchy of the root view controller, it won't be in the responder chain from its view ->view controller ->super view.... I find such issue by debugging from a view with its nextResponder method. It…
user3349433
  • 480
  • 2
  • 11
0
votes
1 answer

How to pass touch events from one view to another

I have a UIScrollView with a UIView subview, which has a UITableView subview. What I want is for the container scroll view to scroll when the user scrolls on the UITableView. Is there a way to pass the touch event from the child UIScrollView to the…
Chandler De Angelis
  • 2,646
  • 6
  • 32
  • 45
0
votes
1 answer

UITextField becomeFirstResponder triggers _resignFirstResponder

I am programatically creating a UITextField, adding it to view and then start editing by calling [textField becomeFirstResponder]; But the issue is this call triggers call to textFieldDidEndEditing: delegate method. The stack trace points to…
Deepak Sharma
  • 5,577
  • 7
  • 55
  • 131
0
votes
1 answer

How to change/break Responder Chain?

In UIViews, the next responder is its superview by default. In my project, there's a scroll view and a small uiview as scroll view's child view. I want if I touch in the small view, the scroll view shouldn't move. Let the responder chain break at…
leavez
  • 2,119
  • 2
  • 27
  • 36
0
votes
1 answer

Order of UIMenuItems in custom edit menu

I want to add my own commands to the selection menu, but also keep the standard "copy", "cut", etc. commands. I use this: UIMenuItem *myItem = [[UIMenuItem alloc] initWithTitle:@"My Command" action:@selector(myCommand:)]; [[UIMenuController…
illyge
  • 183
  • 1
  • 8
0
votes
2 answers

UIControl Target Action event not flowing up the responder chain

I've got a UIButton inside a UITableViewCell which is held in a table, which is owned by my UITableViewController subclass. I'm trying to make use of the feature of target/action pairs where it can bubble up events to its next responder until it…
jbrennan
  • 11,943
  • 14
  • 73
  • 115
0
votes
1 answer

UIControl with A Custom inputView in an Alert Level Window

I've got a custom alert view, which appears in its own UIWindow with its windowLevel property set to UIWindowLevelAlert. The alert has a text field with a regular keyboard, and a custom UIControl subclass that returns a UIDatePicker as its…
Austin
  • 5,625
  • 1
  • 29
  • 43
0
votes
2 answers

Displaying a view over an imageview which is moveable

I currently have an application where a user takes a photo or chooses from their library. On the next controller it will show the image that was selected/taken. What I would like to do now is show a view of some sort on top of the image view. The…
StuartM
  • 6,743
  • 18
  • 84
  • 160
0
votes
1 answer

Passing touches to a UIView

I have one view that has 2 sub views, let's call it a parent view. Those 2 sub views (let them be A and B), overlap, A is covering a portion of B. B view has some buttons on it, one of which is covered by A. Since A background color is clear color,…
MegaManX
  • 8,766
  • 12
  • 51
  • 83
0
votes
0 answers

Change First Responder

Is there any way to change the first responder halfway through a touch event? I have a popover that should dismiss and resignFirstResponder if it recognizes a UIPanGesture. However, it still keeps the firstResponder until about a second later after…
aeubanks
  • 1,261
  • 1
  • 12
  • 12
0
votes
1 answer

UIViewController not passing touches to other Views

I have an overlay view (covering the entire screen), I can receive touches but it isn't passing them down the responder chain. I add the subview like this: UIWindow *mainWindow = [[UIApplication sharedApplication] keyWindow]; [mainWindow…
skwashua
  • 1,627
  • 17
  • 14
0
votes
1 answer

how to extract more touch points from UIResponder?

When I touch a UIView with the base of my finger tip, and get the touch point using touches anyObject, I get a single touch point, even though the base of my finger tip has an area that touches a lot many points. Is there a way to get all those…
Sonu Jha
  • 719
  • 3
  • 13
  • 23
0
votes
2 answers

In iOS how to get Global touch event notification in background running state?

I am looking for a way to get notified about any user initiated touch event while my app is in background running state, I want to make it clear I don't want to handle gesture events or break UIResponder chain, some form of notification that user…
Abhinav Singh
  • 7,880
  • 1
  • 23
  • 33
0
votes
1 answer

Programmatically cancel user scrolling a UIScrollView

I'm using KVO to observe the the contentOffset property of a UIScrollView. When the user is pulling the scrollView down and the contentOffset.y == -50.0, I want the scroll view to release as if the user took their finger off the screen. Is there…
Darren Findlay
  • 2,533
  • 2
  • 29
  • 46
0
votes
1 answer

UITextField nextResponder only works once

I have multiple UITextField's and am trying to click next to switch between them. I have set the tags for each one from 1-4. When I run my code, it moves to the second one, but won't move to the third. If I jump textField.tag + 2; it will jump to…