i am using UIScrollview and UITapGestureRecognizer for getting touch event.
Now, i want x and y coordinates for my touch position.
any help Please?
i am using UIScrollview and UITapGestureRecognizer for getting touch event.
Now, i want x and y coordinates for my touch position.
any help Please?
In your gesture recognizer handler:
CGPoint location = [gestureRecognizer locationInView:gestureRecognizer.view];
you could specify a different view, if you need it.
or u can use this also It belongs in a View rather than ViewController, and would look something like this:
-(void)touchesBegan:(NSSet*)touches withEvent:(UIEvent*)evt {
UITouch *touch=[touches anyObject];
CGPoint pt=[touch locationInView:self];
// ...make your button at 'pt'...
}