我正在使用UIPanGestureRecognizer将一个CALayer从一个UIView拖到另一个UIView上。在UIGestureRecognizerState.Changed方法中,我调用移动CALayer的函数:
var touchLocation = recognizer.locationInView(recognizer.view)
self.panForTranslation(touchLocation)
然而,touchLocation返回的是CALayer相对于其框架的位置,而不是屏幕坐标。
我该如何获取手指在屏幕上的确切位置的UITouch位置?