I have managed to get x and y start coordinates during a swipe:
override func touchesBegan(touches: Set<UITouch>, withEvent event: UIEvent?) {
if let touch = touches.first {
let position :CGPoint = touch.locationInView(view)
startX = Int(position.x)
startY = Int(position.y)
}
}
I need the y coordinates during the swipe as well. I have managed to do this in a very roundabout kind of way with the UIPanGestureRecognizer.
There must be some way to make it in as few lines as getting the starting coordinates.
Can anyone help point me in the right direction?
Best regards, Niklas