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

How do I determine what the valid range is for CGPoint on a device when using locationInView of touch events?

I know the iPhone has 480 x 320 and iPad is 1024 x 768 but I don't know how to determine that programmatically. I'd appreciate any help I can get.
Xavier
  • 8,828
  • 13
  • 64
  • 98
2
votes
1 answer

How to track UITouches between two UIViewcontrollers? (using containment)

I have two view controllers appearing on the screen at the same time using view controller containment, implemented the same as in Apple's code example. Call them view controller A (vcA) and view controller B (vcB), and the container view controller…
Matt Miller
  • 1,421
  • 1
  • 15
  • 24
2
votes
1 answer

How to draw straight lines by touch in iphone using a UItouch or Rubber band style drawing

I am new to iPhone development, I am making an application in which i am trying to make a line that is straight so that it doesn't has any irregular curves it must be smooth I have used core graphics but it doesn't seem to be working. Screen shot I…
Deepranshu
  • 69
  • 1
  • 8
2
votes
1 answer

How can I match UITouch objects in Obj-C with corresponding touch objects in WebKit JavaScript?

I can't figure out a good way to match UITouch objects in UIKit to their corresponding touch objects in JavaScript. For UITouch, one typically uses the value returned by hash message to identify the UITouch instance across touch phases. In HTML /…
charlie roberts
  • 1,659
  • 2
  • 13
  • 7
2
votes
2 answers

how to detect which subview is touched programmatically

I have searched a lot over the net but have not been able to find out anything specific. I guess it is not a very big issue, but I am unable to figure it out. I am working on a UIImageView "A", and then I add some other UIImageViews as the subview…
2
votes
0 answers

How to rotate a CALayer on touch?

I am making a analog clock.It has a hand which can be used to set the alarm time.I am using CALayer for this purpose.It has clock hand image as its contents. 1)How can i rotate or drag this hand on touch without animation in both clockwise and…
1
vote
2 answers

UITouch - Is it possible to disable multiple tapping

I would like to have each UITouch instance record a single tap. In other words, regardless of how close multiple taps occur in time, I would like them each to create a unique touch instance. Is this possible? Thanks, Doug
dugla
  • 12,774
  • 26
  • 88
  • 136
1
vote
6 answers

iOS : detect UIImageView for UITouch Events

I've added some UIImageView dynamically and filled it with different images, what I am trying to do is "Allow user to set position for any UIImageView", for that I used -(void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { //Here I…
Hemang
  • 26,840
  • 19
  • 119
  • 186
1
vote
2 answers

Get Touch point in CAShapelayer

i am drawing line by this code: - (void) drawLine:(float)x :(float)y:(float)toX:(float)toY { CAShapeLayer *lineShape = nil; CGMutablePathRef linePath = nil; linePath = CGPathCreateMutable(); lineShape = [CAShapeLayer layer]; lineShape.lineWidth =…
PJR
  • 13,052
  • 13
  • 64
  • 104
1
vote
2 answers

UITouch & UIEvents: fighting the framework?

Imagine a view with, say, 4 subviews, next to each other but non overlapping. Let's call them view#1 ... view#4 All 5 such views are my own UIView subclasses (yes, I've read: Event Handling as well as iOS Event Guide and this SO question and this…
verec
  • 5,224
  • 5
  • 33
  • 40
1
vote
1 answer

Trace a CGPath/UIBezierpath

I would like the user to be able to trace a predefined CGPath/UIBezierpath with their finger and get a warning if they go outside of the lines (say the line thickness is e.g. 30px to make it easier). How would I perform such a check based on the…
ESoft
  • 852
  • 1
  • 8
  • 21
1
vote
2 answers

CC UITouches disregarding the second touch

I'm trying to move a sprite around using UITouch and i need to be in multi touch mode because i have a button i also need to hit while i'm moving my sprite around. The issue is when i miss the button and i hit the screen with my other finger the…
michael
  • 11
  • 2
1
vote
1 answer

How to manage UITouch events on UIScrollView?

I have an issue not resolved yet related to video embeding into PDF file. I'm having UIWebView object on scrollView. sample code: NSURL *url=[[NSURL alloc]…
Loquatious
  • 1,791
  • 12
  • 21
1
vote
2 answers

UITouches "lost" during multitouch

I'm having trouble getting a UIView to respond how I want with multiple touches. Basically certain UITouches are in UITouchPhaseBegan but never make it to UITouchPhaseEnded or UITouchPhaseCancelled. Here's the code I'm using to handle touches, which…
Luke
  • 7,110
  • 6
  • 45
  • 74
1
vote
1 answer

How to add movable UIView as subview with dynamic size at runtime in objective C?

I need to add a UIView as subview of a UIView where a UIImageview is displayed. What I need to implement is that when the image is loaded in my UIIMageview, at the same time I am showing the UIView call it as newView. In the beginning,I am showing…
Yama
  • 2,649
  • 3
  • 31
  • 63