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
2 answers

UIGestureRecognizer that cancels when touchup outside of targetView

I have a UIView of which I want to know when the user is doing: touchDownInside (to highlight the view) touchUpInside (to confirm the action) touchUpOutside (to cancel and reset the hightlight) what gestureRecognizer can do this for me?
Jakob
  • 1,126
  • 3
  • 16
  • 38
2
votes
1 answer

MultiTouch control of a sprites movement - cocos2d

I've been dealing with this problem for quite some time. What I am trying to do is have a CCSprite's right/left movement controlled by touches on either the left side of the screen or the right. Doing this is no problem if you lift your finger after…
Alexander Blunck
  • 1,224
  • 13
  • 17
2
votes
1 answer

How to access the UITouch locationInWindow coordinates

I am using Cocos2D to develop a mini iPhone game.. I wanted to detect the touch of a sprite. To do so I decided not to subclass the CCSprite class but instead using the touch events in the layer class: -(void) ccTouchesBegan:(NSSet *)touches…
mm24
  • 9,280
  • 12
  • 75
  • 170
2
votes
1 answer

prevent uitableview from cancelling touch events after a horizontal touch

I have a UITableView. If you touch a row, and then slide your finger left or right, it seems to block any further UITouch events from being recognized. I have 2 tableviews. I want to be able to slide a row from the right tableview to the left, and…
Wise Shepherd
  • 2,228
  • 4
  • 31
  • 43
2
votes
1 answer

iOS touch events not being received in the correct order (touch ended not called at the right time)

So I'm trying to capture the following behavior in this exact sequence touch 1 STARTED touch 1 moved touch 1 moved touch 2 STARTED touch 2 moved touch 2 ENDED touch 1 moved touch 1 moved touch 1 ENDED But instead they are coming back in the wrong…
Joe
  • 659
  • 1
  • 8
  • 17
2
votes
2 answers

CGRectContainsPoint() isn't returning TRUE even though the rect contains the point?

I have a UIView with a UIImageView inside it. When someone tries to drag the image view, the image view should follow the person's finger. Below is the code from the UIView's class. - (BOOL)continueTrackingWithTouch:(UITouch *)touch…
Mahir
  • 1,684
  • 5
  • 31
  • 59
2
votes
1 answer

How to register touches on a different view as a user drags their finger to a new one?

So let's say I have a leftView and a rightView in my iOS app. Right now both views are independently registering touches. If I drag my finger from the leftView to the rightView, the leftView continues to register touches even though my finger is now…
Joe
  • 659
  • 1
  • 8
  • 17
2
votes
2 answers

Smaller UIView in UIScrollView to stop touches

I've read the various threads on this but none have given me the exact solution I need, but they have got me pretty close I have the topmost UIViewController which contains a paging UIScrollingView (created via the xib) The UIScrollingView loads an…
JulianB
  • 1,686
  • 1
  • 19
  • 31
2
votes
1 answer

Why do we simulate touches in UIWebView?

I find this code interesting. But I didn't understood why do we simulate touches in UIWebView? enter code here - (void)embedYouTube:(NSString *)urlString frame:(CGRect)frame { NSString *embedHTML = @"\ \
Voloda2
  • 12,359
  • 18
  • 80
  • 130
2
votes
0 answers

How to add delay to touch events just like the UIScrollView does

How to add delay to touch events just like the UIScrollView does? I want to check move events before passing the touch events to subviews? The UIScrollView could do this, scrolling the subviews before click on them. But I don't want to scroll the…
Slavik
  • 1,053
  • 1
  • 13
  • 26
2
votes
0 answers

Allow interaction with view behind depending on UITouch.TouchType using point(inside:with:). (PKCanvasView)

The problem I am trying to intercept touches on a view using the following logic: Determine whether UITouch.TouchType is .pencil If not .pencil, pass touches through to view below Else if .pencil, handle touch. (UIGestureRecognizer) My…
santi.gs
  • 514
  • 3
  • 15
2
votes
2 answers

CCTouchesBegan - CCTouchesEnded need both coordinates

first of all i am new to Cocos2D and Obj-C so i do encounter maybe simple problems like this. my problem looks like this: there is a sprite on the screen and the user will have to touch the top of it and while still pressed move a bit upwards and…
2
votes
1 answer

Changing locationinview UITouch

i'm using this code below to drag an image across the screen. The one thing i like to change is the location of the image. Right now, the location changes to every touch so everytime i try to move it, it translate to my finger. How do i make it so…
hakimo
  • 203
  • 1
  • 5
  • 9
2
votes
1 answer

How to implement mouse over method?

how to implement mouse over event/method in iphone application??
Nirav Jain
  • 5,088
  • 5
  • 40
  • 61
2
votes
2 answers

How can I tell my app to ignore a specific touch?

My iPad app needs to be able to completely dismiss specific touches i.e. those that come from a finger or stylus and not from, say, the palm of your hand. The view has multi-touch enabled so that I analyse each touch separately. I can currently…