I am trying to implement a UILongPressGestureRecognizer in an iOS app. It fires as expected, but I don't see anyway of passing screen coordinates to my target method. Does anyone know how to do this?
This seems to work as an action:
- (void)receivedLongPress:(UIGestureRecognizer *)gestureRecognizer
{
CGPoint coords = [gestureRecognizer locationInView:gestureRecognizer.view];
}
I still don't really understand (it seems like the last touch point is stored in the gestureRecognizer, in which case I would expect there to just be a property or something). But hey, it works.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With