Questions tagged [uitouch]

UITouch is a class from UIKit framework in Apple iOS. A UITouch object represents the presence or movement of a finger on the screen for a particular event.

A UITouch object includes methods for accessing the view or window in which the touch occurred and for obtaining the location of the touch in a specific view or window. it also lets you find out when the touch occurred, whether the user tapped more than once, whether the finger is swiped (and if so, in which direction), and the phase of a touch—that is, whether it began, moved, or ended the gesture, or whether it was canceled.

A UITouch object is persistent throughout a multi-touch sequence. You should never retain an UITouch object when handling an event. If you need to keep information about a touch from one phase to another, you should copy that information from the UITouch object.

666 questions
103
votes
8 answers

Click Event on UIImageView programmatically in ios

I am displaying a image from code here is the code UIImageView *preArrowImage =[[UIImageView alloc]init ]; preArrowImage.image =[UIImage imageNamed:@"arrowprev.png"]; preArrowImage.frame = CGRectMake(20, 60, 10, 30); [self.view…
Sumit Patel
  • 2,547
  • 8
  • 33
  • 45
98
votes
10 answers

How can I detect the touch event of an UIImageView?

I have placed an image (UIImageView) on the navigation bar. Now I want to detect the touch event and want to handle the event. How can I do that?
ebaccount
  • 5,051
  • 11
  • 43
  • 47
72
votes
4 answers

UIScrollview getting touch events

How can I detect touch points in my UIScrollView? The touches delegate methods are not working.
user559005
44
votes
14 answers

How to Zoom In/Out Photo on double Tap in the iPhone WWDC 2010 - 104 PhotoScroller

I am going through the Sample code of iPhone WWDC 2010 - 104 PhotoScroller App. It's working great with my project related images (PDF Page Images) but I am struggling detect touches in the PhotoScroller App. The Zooming using multiple touches is…
Roger_iPhone
  • 737
  • 1
  • 9
  • 20
39
votes
8 answers

Detect if certain UIView was touched amongst other UIViews

I have 3 UIViews, layered on top of one large uiview. I want to know if the user touches the top one and not care about the other ones. I will have a couple of buttons in the second UIView and a UITable in the 3rd UIView. Problem is I turn…
Rudiger
  • 6,749
  • 13
  • 51
  • 102
35
votes
2 answers

UIButton TouchUpInside Touch Location

So I have a large UIButton, it is a UIButtonTypeCustom, and the button target is called for UIControlEventTouchUpInside. My question is how can I determine where in the UIButton the touch occured. I want this info so I can display a popup from the…
Andrew
  • 3,874
  • 5
  • 39
  • 67
30
votes
9 answers

UIControl Not Receiving Touches

I have a UIControl which implements the touches began method like so: - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { [super touchesBegan:touches withEvent:event]; //More code goes here This subclass of UIControl is…
Kyle Rosenbluth
  • 1,672
  • 4
  • 22
  • 38
25
votes
4 answers

Swift - programmatically click on point in screen

tl;dr- How can I programmatically perform a native touch in specific point on the screen? Within the web view there is HTML that contains an Iframe, so the web view code and elements are not accessible and sanding massages to JS is not possible…
Luda
  • 7,282
  • 12
  • 79
  • 139
22
votes
12 answers

How to cancel a sequence of UITouch events?

I have a UIImage view that responds to touch events. I want to cancel the touch sequence, i.e., further calls to touchesMoved:, if the touch goes outside of certain bounds. How can I do that? I know that in touchesMoved: I can inspect the…
subjective-c
  • 1,833
  • 9
  • 25
  • 35
20
votes
5 answers

When touches Cancelled method get invoked in iPhone?

I am able to understand that when user just touches the view, touches Began and Ended called. When user swipes their hand on a view, touches Moved method gets called. But when does touches Cancelled get called or by what action on user this method…
RK-
  • 12,099
  • 23
  • 89
  • 155
20
votes
3 answers

UISystemGateGestureRecognizer and delayed taps near bottom of screen

What are the standard UISystemGestureGateGestureRecognizers installed on the top level UIView of an iOS app for? My app consists of two views - one fills the top half of the screen, the other is a custom keyboard and fills the bottom half. I found…
Brad Robinson
  • 44,114
  • 19
  • 59
  • 88
20
votes
8 answers

UIButton with hold down action and release action

I want to create a UIButton that can be held down, when held down it calls the "hold down" action once. when it is released, calls the "hold was release" action. This code isn't working correctly because the touch can move inside the button and the…
Avba
  • 14,822
  • 20
  • 92
  • 192
19
votes
6 answers

Getting the UITouch objects for a UIGestureRecognizer

Is there a way to get the UITouch objects associated with a gesture? UIGestureRecognizer doesn't seem to have any methods for this.
Morrowless
  • 6,856
  • 11
  • 51
  • 81
19
votes
5 answers

How to find out what view a touch event ended at?

I wish to drag a UIImage on to one of several UIButtons and have it repositioned based on which button I drag it to. The problem I've ran in to is that UITouch only records the view where my touch began, I'd like to access the view my touch ends at.…
Declan McKenna
  • 4,321
  • 6
  • 54
  • 72
16
votes
2 answers

How do you tell what object is being touched in touchesBegan?

I know that this is a very commonly asked question, but all of the answers on every website don't work! If you still don't know what I mean, then maybe this line of code will help you understand. - (void)touchesBegan:(NSSet *)touches…
Flafla2
  • 691
  • 2
  • 11
  • 21
1
2 3
44 45