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

why cant we detect a UITouch logic on UITableView, Objective C

I searched but not quite understand why we cant detect a UITouch on UITableView. What I am having right now is :a view controller with a table view located in its view. Please look at the picture below for your reference In implementation class, I…
tranvutuan
  • 6,089
  • 8
  • 47
  • 83
2
votes
3 answers

iOS Multi-Touch Not Working

I have the regular OpenGL / EAGL setup going on: @interface EAGLView : UIView { @public EAGLContext* context; } @property (nonatomic, retain) EAGLContext* context; @end @implementation EAGLView @synthesize context; + (Class)layerClass { …
Mike Weir
  • 3,094
  • 1
  • 30
  • 46
2
votes
1 answer

Limiting a pan gesture recognizer to a specific circle

I am using a circular gradient, drawn in an image view, as a color wheel for my color picker. I want to limit the pan gesture recognizer's shouldReceiveTouch: to the gradient's position so that the rest of the view is not affected by the pan gesture…
Exothug
  • 339
  • 4
  • 18
2
votes
3 answers

how to dismiss a UIPickerView in ios

In my app, i have pickerviews in my add contact page. I have given the following 'touchesBegan' method. But it dismisses the picker even when i click on a value to set. For example, if i click 'homephone' from preferred phone picker, the picker gets…
Mano
  • 670
  • 1
  • 9
  • 28
2
votes
1 answer

How to Better Drag a UIButton? UIButton UIControlEventTouchUpInside Event Is Not Called

My draggable button is using these events to be dragged: [button addTarget:self action:@selector(beganDragging:) forControlEvents:UIControlEventTouchDown]; [button addTarget:self action:@selector(wasDragged:withEvent:) …
Vad
  • 3,658
  • 8
  • 46
  • 81
2
votes
2 answers

Draw a 5 pixel line on UIView

I have a very simple (well hopefully very simple) question. In Objective-C, how do you draw a line between two points and add it to a UIView? I have tried using a UIImageView and manipulating its Transform property, but that ends up turning the line…
Liftoff
  • 24,717
  • 13
  • 66
  • 119
2
votes
0 answers

UIGestureRecognizer interrupt UITouch methods

I have a table with custom cells, which has subclass UITableViewCells and for touches animation I use UITouch (code based on this tutorial http://gregprice.co.uk/blog/?p=280) Index of cell under touch I get with using didSelectRowAtIndexPath. I…
sasa
  • 23
  • 2
2
votes
2 answers

CGContextSaveGState 0x0 in UIBezierPath

I am trying to use Apples method for detecting if a point is in on a UIBezierPath. However it returns an ‘invalid context’. As you can see from the NSlog, I am passing a UIBezierPath and A point to check. In my case a touch point. I don’t understand…
JasonBourne
  • 338
  • 2
  • 13
2
votes
4 answers

Detect touch of UIImage added as subview of UIScrollView

I have UIScrollView with many UIImageViews.I need to drag and drop image from UIScrollView to another view. Outside the scrollView touch is worked. But inside scroll view touch is not worked. I used touchesBegan,touchesMoved etc method. Please help…
IKKA
  • 6,297
  • 7
  • 50
  • 88
2
votes
3 answers

Finding touch point in Objective c/cocoa touch

I have a problem to find the touch point. I have a function loadView() where I set 16 tiles(16 UIImageView). Then In function: - (void) touchesBegan:(NSSet*)touches withEvent:(UIEvent*)event { // Retrieve the touch point UITouch…
russell
  • 3,668
  • 9
  • 43
  • 56
2
votes
3 answers

UITableView doesn't scroll

So, this is my view: and this is my UItableViewDelegate and DataSource -(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 1; } -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { …
Marco Manzoni
  • 707
  • 3
  • 11
  • 21
2
votes
1 answer

Send automated touch event coordinates to a UIView

Is there a way to fake touch events by faking a tap on the screen at a certain coordinate? The problem im trying to solve is rendering a webpage to a opengl texture on a quad. Touches inside the quad need to be mapped to the view the webpage is…
Fonix
  • 11,447
  • 3
  • 45
  • 74
2
votes
1 answer

Prevent dragging UIButton outside of its UIView

I've got two UIViews on my window: one to hold player scores, (a sidebar), and a main play area. They both fit on the UIWindow, and neither scroll. The user can drag UIButtons around on the main play area – but at present, they can drop them onto…
Luke
  • 9,512
  • 15
  • 82
  • 146
2
votes
2 answers

Bounce UIImageView back when dragged off screen

What I need is when a UIImageView is dragged off of the screen it to bounce back when it gets let go. I have it working in the left and top sides this is what I am doing. - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { …
Jonathan
  • 507
  • 5
  • 15
2
votes
1 answer

Simulating UITouch in xCode 4.5 programmatically (UISpec)

I'm using UISpec for automated testing in my project. Everything was fine until Apple released xCode 4.5 with iOS 6 SDK. Now UISpec project can't be compiled because a list of errors in category of UITouch class. Here is the code: // // …
alfared
  • 173
  • 1
  • 1
  • 9