I'm dragging a CALayer out of one UIView to another using a UIPanGestureRecognizer. In the UIGestureRecognizerState.Changed method, I am calling to move the CALayer with
var touchLocation = recognizer.locationInView(recognizer.view)
self.panForTranslation(touchLocation)
However touchLocation is returning the CALayers position relative to it's frame, not the screen coordinates.
How can I get a UITouch location of the exact point the finger is on screen?
Try this:
var touchLocation = recognizer.locationInView(recognizer.view.window)
self.panForTranslation(touchLocation)
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