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
1 answer

canPerformAction:with sender method called on tap in ios 9

one thing I observed in iOS 9.0 is that when I tap on button or TableView, canPerformMethod:withSender: method is called with sender as UIButton type. I am using this method to prepare my customized option menu. I did not observed that in previous…
pratik03
  • 651
  • 2
  • 7
  • 23
0
votes
1 answer

How to send next responder from custom button on tableviewcell to UITableViewController?

UPDATE: i have MENUViewController and i insert this view to TableViewCell, when i press button on MENUViewController how to pass nextResponder to TableViewCell ? from LOG at my button in MENUViewController class->NSLog(@"nextResponder = %@",…
RAGOpoR
  • 8,118
  • 19
  • 64
  • 97
0
votes
1 answer

App crashes when navigating back and UIAlertview button is pressed

I have my own chat window similar to like Apple Messaging screen. There is a scenario that i am chatting in a groupchat and the group owner deletes the group from some other device. What i do in that case is i remove all the messages and show do a…
Madu
  • 4,849
  • 9
  • 44
  • 78
0
votes
2 answers

custom Copy Responder in iphone

I have a webview in my application. I want to handle when user copies something from web view, my custom method - should be triggered. I have tried following. I have placed following method in myViewCtr.m file -(void)copy:(id)sender{ NSLog(@"hi…
sagarkothari
  • 24,520
  • 50
  • 165
  • 235
0
votes
1 answer

UI not responding when popover is presented

I have 2 buttons say button1 and button2. A popover will be presented when we tap on button1. When popover is presented, if we tap on button2, it does not respond to tap action instead popover will be dismissed. What i need is, When we tap on…
0
votes
1 answer

UIResponder Assistance - Method Not Called

I have implemented HandOff using NSUserActivity, I initially implemented the following methods directly in my ViewController class, and all is working as expected. -(void)updateUserActivityState:(NSUserActivity…
Duncan Hill
  • 547
  • 2
  • 5
  • 16
0
votes
1 answer

View gesture handling: Detecting gestures on a big view which is a subview of a small view

I am confusing about gesture handing on UIViews, Say there are three views in the view hierarchy. Like this image shows: V1 (Grey) | + V2 (Orange) | + V3 (Red) Each View has an attached tap gesture, V1 has gesture1 V2 has gesture2 V3…
Honghao Z
  • 1,419
  • 22
  • 29
0
votes
1 answer

How do I forward an action message to the next responder?

if I have something like: void maybeHandleMessage: sender: AnyObject { if isHandling() { handle() } else { // forward action message to next responder in the responder chain } } What code do I need in the else clause to…
0
votes
0 answers

How does UIKit know which view should accept touch events?

I have a button view that displays a popup view when touched. The popup view overlaps the button completely, but all touchesMoved:withEvent: and touchesEnded:withEvent: events are still routed to the button view. What if I want to handle touches in…
zoul
  • 102,279
  • 44
  • 260
  • 354
0
votes
3 answers

why UICollectionView not calling didSelectItemAtIndexPath any more after scrolling the scrollView of it's cells?

I am using the UICollectionView to display some products. In the custom UICollectionViewCell, there is a custom UIScrollView, where there are some images which allow the users to do a quick preview. To forward tap gesture from the UIScrollView to…
chancyWu
  • 14,073
  • 11
  • 62
  • 81
0
votes
2 answers

How to detect any Touch in a UIView?

I have this code and the method is not called, what can I do? I need a delegate? -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [touches anyObject]; if ([touch view] == self.view) { } }
Fabio
  • 1,913
  • 5
  • 29
  • 53
0
votes
0 answers

How to call a superview's touchesBegan:(NSSet*)touches withEvent:(UIEvent*)event method?

I created a UIView subview which I add to my UIViewController in storyboard, I want to respond to a tap on the subview and call the superview's implementation of the following method. The call works properly, but it doesn't pass as an argument the…
Michael
  • 6,561
  • 5
  • 38
  • 55
0
votes
1 answer

iOS7 Keyboard Behavior with SearchBar/UITableView: Offset on secondary view appearances

Problem I am having a rather big issue with the iOS7 keyboard appearance. I have a Searchbar on a UIViewController with TableView Delegation/Data Source setup (I am using the self.searchDisplayController delegates as well). I segue from this scene…
Tommie C.
  • 12,895
  • 5
  • 82
  • 100
0
votes
1 answer

Which UIView initiated UIKeyboardWillShowNotification

Many of my views implement methods for a notification for UIKeyboardWillShowNotification they move around internal views to move out of the way of the keyboard. Problem I have is that I don't know which view triggered the notification. How can I…
Avba
  • 14,822
  • 20
  • 92
  • 192
0
votes
1 answer

Calling endEditing in custom container view controller hides keyboard but doesn't change keyboard responder

In my custom container view controller I need to hide the keyboard when some things occur. Because I don't know who the first responder is I just force close it as follows: for (UIViewController *child in self.childViewControllers) { …
Avba
  • 14,822
  • 20
  • 92
  • 192