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

UITouch returns UIWebBrowserView (Apple internal component) instead of UIWebView

I have a UIWebView and I want to detect any touch on that. (I don't want to use UITapGsture or any other thing) I am using sendEvent: method of UIApplication for this purpose and check if touch object contains webview. Surprisingly it points to…
Kunal Balani
  • 4,739
  • 4
  • 36
  • 73
3
votes
2 answers

How to send a touch event to iPhone OS?

Im writing an app running in background on a jailbreak iphone. I need to send touch event to iPhone OS to simulate finger touches. Is this possible?
xiaoma
  • 31
  • 1
  • 1
  • 2
3
votes
3 answers

Why is only one UIEvent created for many separate touches?

I'm learning the touch event mechanism of iOS. From the documentation I understood that a UIEvent object would be created when first touch down happened, it would live till the last touch up, and it would contain all the UITouch objects created in…
Suge
  • 2,808
  • 3
  • 48
  • 79
3
votes
4 answers

How to connect two buttons( dots) with a line in iOS?

I want to make a project in which I have to touch one dot and connect it with another dot and after connect it to another dot. When I connect one dot with another dot the line will create between them. Actually when I click/ touch one dot The line…
Nisha Singh
  • 143
  • 4
  • 12
3
votes
1 answer

Event handling in subclass of UIView

As the guide Event Handling Guide for iOS mentions, when you create your own subclass of UIView: All views that process touches expect to receive a full touch-event stream, so when you create your subclass, keep in mind the following rules: - If…
hrchen
  • 1,223
  • 13
  • 17
3
votes
2 answers

Touch events (touchesMoved) not working on UIViews inside UIScrollView

I have a UIView inside a UIScrollView, and the UIViewControllers for those views are not receiving the touch events. If I take the views out of the scroll view then it works. UserInteraction is default ON of all views but it's still not…
Zeeshan
  • 586
  • 7
  • 15
3
votes
5 answers

Move UIImage only inside of another UIImage

I have an UIImage which is shown in an UIImageView. I also have another image in an UIImageView which lays above the first image. I want to be able to drag the second image only within the borders of the first image. To make my goal a bit more…
dehlen
  • 7,325
  • 4
  • 43
  • 71
3
votes
2 answers

How to "transfer" first responder from one UIView to another?

I have a UIView subclass (CustomView for purposes of this question) that has its own handling of all touches events (Began, Moved, Ended, Cancelled). I also have a UIButton that is a sibling of CustomView that overlaps it. For example, my view…
Jason
  • 28,040
  • 10
  • 64
  • 64
3
votes
5 answers

Touch events not working on UIViews inside UIScrollView

I have a series of UIViews inside a UIScrollView, and the UIViewControllers for those views are not receiving the touch events. If I take the views out of the scroll view then it works. I have enabled userInteraction on the views but it's still not…
Michael Waterfall
  • 20,497
  • 27
  • 111
  • 168
3
votes
2 answers

touchesEnded:withEvent: not called when a drag event moved out of the screen top/bottom

My problem is quite strange but simple. I subclassed a my customer UIScrollView: MyScrollView, where i disabled the scroll: self.scrollEnabled = NO; that means apart from - (void)scrollViewDidScroll:(UIScrollView *)scrollView all other…
Roen
  • 116
  • 6
3
votes
1 answer

Objective-C: Get the UITouch for which the UIEvent was triggered

I can't find anywhere in the documentation. When this message is called on my subclass of UIView: - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event How can I get the touch for which this message was called ? On both the NSSet and…
Nicu Surdu
  • 8,172
  • 9
  • 68
  • 108
2
votes
2 answers

Resize a UIButton with touch events

How can we resize a UIbutton in IOS,i have a button with CGRectMake (30,50,120,200)when the application is running ,the user can taptohold or pinch gesture to make the button big or small according to his needs.lke the zooming function of scrollview…
stackiphone
  • 1,245
  • 3
  • 19
  • 41
2
votes
1 answer

UITouch on overlapping UIViews

I have two views each of which contain two subviews. Hit detection is working fine as long as the two top views do not overlap. Hence I can touch subview marked A in the left side of the image below. However as soon as the top two views overlap,…
verec
  • 5,224
  • 5
  • 33
  • 40
2
votes
2 answers

Detect touch coordinates on a sinle UIImageview

I have a single imageview with a static country map divided into regions of that country. What I'd like to do is detect the touch location on the image and provide content about the corresponding region. Since region borders are not linear, how can…
Eren Beşel
  • 1,047
  • 8
  • 16
2
votes
2 answers

Catch touch events anywhere onscreen in certain views?

I have a menu which I'd like to have automatically hide if it's inactive after a certain amount of time. This menu is composed of a hierarchy of UIViewControllers, which present various different views. I'm thinking along the lines of running a…
Moshe
  • 57,511
  • 78
  • 272
  • 425