Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UISwipeGestureRecognizer gesture start point

Is it possible to get a gesture start point from a UISwipeGestureRecognizer. like how its possible in

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {

    UITouch * touch = [touches anyObject];
    gestureStartPoint = [touch locationInView:self];
}
like image 966
Rupert Avatar asked Dec 21 '22 22:12

Rupert


1 Answers

According to the UISwipeGestureRecognizer documentation you can:

You may determine the location where a swipe began by calling the UIGestureRecognizer methods locationInView: and locationOfTouch:inView:. The former method gives you the centroid if more than one touch was involved in the gesture; the latter gives the location of a particular touch.

PS: you really should first look at the documentation, the answer was in the class reference of UISwipeGestureRecognizer, shouldn't be hard to find. Part of being a developer is being able to look things up, Apple has excellent documentation, use it!

like image 84
ynnckcmprnl Avatar answered Jan 01 '23 22:01

ynnckcmprnl