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
6
votes
4 answers

Comparing a UITouch location to UIImageView rectangle

I have the following code to determine if a touch is within an image view in my table cell. However, it doesn't work. I compared the two with CGRectContainsPoint however, it doesn't work. Here is the code: -(void)touchesBegan:(NSSet *)touches…
skylerl
  • 4,030
  • 12
  • 41
  • 60
6
votes
2 answers

touchesBegan: withEvent: is not called when tapped on a UIButton

What I want to implement is column matching type functionality. I have three buttons on right column and three on left column with some info on them. I want to draw path from one button on right side to any of the button on left side by dragging…
iosDeveloper
  • 169
  • 2
  • 8
6
votes
1 answer

iPhone Objective C: How to get a pixel's color of the touched point on an UIImageView?

iPhone Objective C: How to get a pixel's color of the touched point on an UIImageView, even if the parent UIView or itself is being rotated by the CGAffineTransformMakeRotation function? Will the view property of the UITouch still correctly return…
Unreality
  • 4,111
  • 11
  • 48
  • 67
5
votes
2 answers

How to add gesture recognizers to multiple buttons?

Hi, I am trying to add gesture recognizers to 'UIButton'. When I do it like this: UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleSingleTap:)]; [self.LeftBottomSpaceBtn…
Nik's
  • 690
  • 1
  • 10
  • 27
5
votes
3 answers

How to control the number of simultaneous touches on a view in iOS

I have a UIView which contains almost 10 buttons which performs different actions. The user will be able to touch or tap on any button to perform a required action. But, i am getting a problem when the user presses multiple buttons at the same time.…
A for Alpha
  • 2,904
  • 8
  • 42
  • 76
5
votes
3 answers

Detect only double or single tap with UIViews?

I want to detect JUST double / single tap when the user touches a view. I made something like this: - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [touches anyObject]; CGPoint prevLoc = [touch ] …
trung nguyen
  • 121
  • 2
  • 8
5
votes
2 answers

How to move a UIImageView after applying CGAffineTransformRotate to it?

I'm building an iPhone app. I have a UIView that contains a set of UIImageView subclass objects. The user can drag and rotate the image views via touch. I'm having trouble moving the image view after it has been rotated. To rotate an image view, I…
richardsun
  • 3,245
  • 1
  • 18
  • 22
5
votes
1 answer

UIControl touches not behaving correctly on left side of VC

I have a UIControl (subclass of UIView), and when I create it and align it to the left side in my view controller, the "beginTrackingWithTouch" fails to get called when I touch the view. It will only get called when I release the touch. What is…
Josh O'Connor
  • 4,694
  • 7
  • 54
  • 98
5
votes
2 answers

iOS draw line with both arrow with start-end point while finger touch end and rotate from start or end point

I need help making a drawing demo. When the user draws a line using their finger, the line has directional arrows on both ends. When their finger releases, it draws the line with "?" (question-mark) in center of the line. Then, when user taps on the…
Nikunj Jadav
  • 3,417
  • 7
  • 38
  • 54
5
votes
1 answer

What is the touches canceled event, and how is it different from touches ended

I just don't understand what apple means by the touches canceled event and how is it called.
Jab
  • 26,853
  • 21
  • 75
  • 114
5
votes
2 answers

Propagating touch events through sibling subviews?

I've got a stack of subviews that are all have user interactive sections (children) and all full screen. The problem is that, if I touch down on a non-interactive section at the top of the stack, it won't then propagate that touch across the rest of…
puzzl
  • 833
  • 9
  • 19
5
votes
1 answer

timestamp and calculating velocity of a swipe

Hey I know there are already a few posts about this - yet I still can't find an adequate answer for the problem I'm having. Just new to cocoa and iOS, I'm in the middle of developing my first iOS game. In this game I would like to be able to…
user1437530
4
votes
0 answers

Drag & Resize UIView using Touches, a working solution asking for feedback

In my app I have a view I want to resize using a two fingers touch similar but not close to what the pinch gesture recognizer provides detection for. The idea is similar to what you would do on the desktop by grabbing one of the four corners with…
verec
  • 5,224
  • 5
  • 33
  • 40
4
votes
2 answers

Detect touch globally

I trying to figure out how to solve this (fairly) simple problem but I failing miserably, so I really need your advice. My application consists of a uitabbar with several tabs. In one of them I have a bunch of UIImageViews each of which represents…
Tomas Camin
  • 9,996
  • 2
  • 43
  • 62
4
votes
1 answer

How to cancel uitouches?

In my app I want to have the users tap on the left side of the screen to increase their speed and swipe on the right side to work a joystick. However, if the user keeps holding the left side, the joystick doesn't work right. I am using…
Greg
  • 1,296
  • 2
  • 11
  • 26