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
1
vote
1 answer

Accelerating elements with touchesBegan: and touchesEnded:

I have a UIImageView that I try to accelerate based on the distance it has been dragged and how fast it was dragged. By accelerating I mean that when touchesEnded: is called, the imageView should slide further in the direction it was dragged. How…
Kasper Munck
  • 4,173
  • 2
  • 27
  • 50
1
vote
1 answer

Why does UITapGestureRecognizer not work properly for cell images in Swift collection view?

I have added UITapGestureRecognizer for collectionview cell image like code: with this code if i tap on two cell images then both are showing. Here if i tap on second cell image then how to remove first image from foreground here touchesBegan not…
iOS work
  • 33
  • 6
1
vote
1 answer

how to pass touchesBegan from UIScrollView to UIViewController

Actually, I want to push data from one view to other. I have a UIScrollView which has images on top of it. Now I want to push the data from that view to other view since whenever I do touch on that image view I want to select the position and push…
lifemoveson
  • 1,661
  • 8
  • 28
  • 55
1
vote
0 answers

Multitouch UITouches after SwiftUI Drag

I'm implementing a SwiftUI control over a UIView's drawing surface. Often you are doing both at the same time. Problem is that starting with the SwiftUI control will block the UIKit's UITouch(s). And yet, it works when you start with the UITouch…
Warren Stringer
  • 1,692
  • 1
  • 17
  • 14
1
vote
0 answers

SwiftUI is missing UITouch properties

When using UIKit for touch events, you will get the UITouch which has the UITouch.force, UITouch.majorRadius but When using SwiftUI, the dragGesture, or any Gesture, you won't get the UITouch, instead, you will get a value that has only touch…
Ziv Adler
  • 169
  • 2
  • 11
1
vote
1 answer

Multi Touch problem in Custom UiTableViewCell

static NSString *cellIdentifier = @"Cell"; AssignmentTableCell *cell = (AssignmentTableCell *) [tableView dequeueReusableCellWithIdentifier:cellIdentifier]; if(cell == nil) { NSArray *nib = [[NSBundle mainBundle]…
chsab420
  • 191
  • 2
  • 3
  • 14
1
vote
1 answer

UIWindow stops receiving touches after removing a subview from it

I'm using a subclass of UIWindow to handle touch event in all views of the app. I'm trying to implement a drag and drop mechanism. When tapping and holding on a view, i remove that view and start dragging with the finger. problem is after i remove…
Or Arbel
  • 2,965
  • 2
  • 30
  • 40
1
vote
2 answers

Get Index of Object in TouchesEnded

i have a UIViewController with many UIImageViews. I need in touchEnded event get a index of this UIimage. How do Make? Thank's
Bruno Leite
  • 1,403
  • 13
  • 17
1
vote
0 answers

Re-issuing a touch event

I'm trying to create an overlay view that monitors for touches and then disappears, but also forwards touch events to whatever is underneath the view. My test app has a view with a button inside. I add the overlay view as another subview (sibling to…
Karl
  • 14,434
  • 9
  • 44
  • 61
1
vote
3 answers

Can we check if an Objc object was deallocated before "bridging" it from void* to UIKit object?

I'm using QTouchposeApplication library (particularly a class TRTouchposeApplication from develop branch). There were crashes in one of the execution paths in master branch, and the author fixed them in develop branch. However, one of the crashes is…
olha
  • 2,132
  • 1
  • 18
  • 39
1
vote
1 answer

iphone: Paint/Draw with All touches?

How can I paint with with 4 fingers simultaneously. I need UI to interact and respond to all touches. I have seen most of the Apps like GLPaint & many more painting apps which only respond to 1 touch. Anyone have idea how can I paint with all…
Tariq
  • 9,861
  • 12
  • 62
  • 103
1
vote
1 answer

Multithreaded Coregraphics Drawing with Multitouch Actions, Swift

I'm developing an app that allows for multitouch inputs, and am having trouble drawing using drawRect in my UIView. When more than one finger is on the screen, I need to draw a rect that encompasses all the UITouch inputs. Is there any best practice…
monotreme
  • 582
  • 1
  • 6
  • 20
1
vote
2 answers

How to drag and drop a UIButton

I have four UIButtons in my interface file. I have outlets attached to each button. I want to be able to drag and drop them across the screen. What is the best way to do this? How can I do this? please help!!!
Blane Townsend
  • 2,888
  • 5
  • 41
  • 55
1
vote
1 answer

handleInputModeList recognising touchUpInside envent

I have code like following. override func viewDidLoad() { super.viewDidLoad() // Some setup button.addTarget(self, action: #selector(handleInputModeList(from:with:)), for: .allTouchEvents) } override func handleInputModeList(from…
Pavan Kumar
  • 1,715
  • 1
  • 24
  • 48
1
vote
1 answer

How to change touch position when passing a UITouch object?

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { if(touchDelegate_) { // before passing the event, I want to scale touch position by 2, how can i do it? // that is, if touch position is (5, 5), I want touchDelegate_…
willzeng
  • 169
  • 1
  • 5