var panRecognizer = UIPanGestureRecognizer(target: self, action: #selector(move))
panRecognizer.minimumNumberOfTouches = 1
panRecognizer.maximumNumberOfTouches = 1
panRecognizer.delegate = self
yourView.addGestureRecognizer(panRecognizer)
@objc func move(_ sender: Any) {
if (sender as? UIPanGestureRecognizer)?.state == .changed {
// This will return you location in view
let currentPoint: CGPoint = sender.location(in: view)
// This will return you location in Scrollview
let scrollPoint: CGPoint = sender.location(in: sender.view.superview)
}
}