Find gesture touch coordinates using locationOfTouch

Hey, trying to find the location of users so that I can have three areas on the screen that can leak out and determine which section they are reacting to based on the y coordinates of their swipe.

This is the code

CGPoint touchPoint = [recognizer locationOfTouch:0 inView:nil];

I tried to print touchPoint.y in the label, and all I get is 0. How do I get the coordinates of users?

Thank.

+3
source share
1 answer

Its a strange but installation-like representation of nileither self.view.windowreturns 0. There is no such behavior and the Apple doc UISwipeGestureRecognizer seems to encourage the search for the source of the swipe using this method. It would be nice to write this under a mistake.

. self.view.

+2

All Articles