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
16
votes
5 answers

A count of started touches is not equal to count of finished touches

I have the following code for testing purposes: - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { [self customTouchHandler:touches]; } - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { [self…
Andrey Gordeev
  • 30,606
  • 13
  • 135
  • 162
15
votes
6 answers

How do I display all touches on screen in order to demo an iPhone app?

Now that we have display mirroring on the iPad 2 (wired now... wireless coming in iOS 5), is there an easy way to display all touches on screen? This would be useful when demoing an app? What I am looking for is the ability to just include some SDK,…
Alex Argo
  • 8,920
  • 12
  • 43
  • 46
15
votes
1 answer

hitTest:withEvent: UIEvent allTouches is empty

I have a custom UIView that implements hitTest:withEvent: -(UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event { .... some code .... int x = 0; x = [[event allTouches] count]; return [super hitTest:point…
Jamil
  • 641
  • 1
  • 7
  • 17
14
votes
2 answers

UITouch touchesMoved Finger Direction and Speed

How can I get Speed and Direction of finger movements in touchmoved function? I want to get the finger speed and finger direction and apply it in a UIView class direction movement and animation speed. I read this link but I can not understand the…
Val Nolav
  • 908
  • 8
  • 19
  • 44
13
votes
2 answers

How to show a PDF page by page using horizontal swipe in iphone?

I want to create a page by page PDF reader. I know how UIWebView can be used to show the PDF but It will load the entire PDF and want to show one page at a time. The PDF is stored locally. Next and previous PDF Pages should be loaded depending on…
Roger_iPhone
  • 737
  • 1
  • 9
  • 20
13
votes
4 answers

Is there any way at all that I can tell how hard the screen is being pressed

I want to find the pressure of the touch. I just don't know how to accomplish that result with out jailbreaking it and getting the raw touch data. Does anyone know How I would do this?
Jab
  • 26,853
  • 21
  • 75
  • 114
11
votes
3 answers

ios How to make UITextView detect one tap?

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ NSLog(@"touchesBegan"); //test UITouch *touch = [event allTouches] anyObject]; if ([touch tapCount] == 2) { NSLog (@"tapcount 2"); [self.textview…
wagashi
  • 894
  • 3
  • 15
  • 39
10
votes
2 answers

what is the difference between touch and tap in iOS

I am confused by the difference between touches and taps like touchUpInside event and one tap. Are they the same thing?
guoleii
  • 496
  • 6
  • 15
10
votes
2 answers

iOS How to dismiss UIAlertView with one tap anywhere?

I want to dismiss UIAlertView anywhere outside it with one tap. I want to show a UIAlertView without any button. I have standard UIAlertView codes here, but I need input how to dismiss it, if it is possible. With UITouch? With…
wagashi
  • 894
  • 3
  • 15
  • 39
10
votes
3 answers

UIButton with custom view - addTarget:action:forControlEvents: does not work

My button is as follows Created label1 Created label2 Created customView (UIView) Added label1 and label2 on custom view Created myCustomButton(UIButton) Added customView on myCustomButton I have already done userInteractionEnable for custom_View,…
Sagrian
  • 1,048
  • 2
  • 11
  • 29
10
votes
5 answers

How to get current touch point and previous touch point in UIPanGestureRecognizer method?

I am new to iOS, I am using UIPanGestureRecognizer in my project. In which I have a requirement to get current touch point and previous touch point when I am dragging the view. I am struggling to get these two points. If I use touchesBegan method…
10
votes
1 answer

iPhone SDK Erase A UIImageView from the Screen Using Touches?

I am looking for a way of being able to erase a UIImageView from the screen. When I say erase I don't mean [imageView removeFromSuperview];, I mean to erase parts of the image by scribbling your finger on the screen. Where ever your finger is, that…
Alec
  • 177
  • 2
  • 16
9
votes
4 answers

How to avoid Touches cancelled event?

I have two views one beneath the another. I'm rotating the below view by touch sensing of top view. while trying to make a swipe, touches canceled event is called before touches ended event. While moving the finger touches began and touches moved…
Ka-rocks
  • 774
  • 1
  • 14
  • 27
9
votes
1 answer

In React Native is there a way to recognize stylus (pen) vs touch (finger) event?

I'm working on the RN application that has one screen with a list of "drawable" areas in it. So this screen should be scrollable AND drawable. What I'm trying to do - is to find a solution to distinguish touch events coming from fingers (these will…
Nadine
  • 559
  • 2
  • 15
9
votes
0 answers

The first touchesBegan and touchesMoved have at least one erratic jump. How do I best capture events for a smooth low velocity touchesMoved situation?

[Questions at the bottom] I am trying to reimplement a UIScrollView for various reasons and noticed that the first touch locations captured via touchesBegan and touchesMoved have one erratic jump, usually among the first ~5 events. This outlier will…
AdrianLoer
  • 624
  • 3
  • 11
1
2
3
44 45