Easiest way to get y coordinates during pan swipe gesture in swift
<p>I have managed to get <code>x and y start coordinates</code> during a <code>swipe</code>:</p>

<pre><code>override func touchesBegan(touches: Set&lt;UITouch&gt;, withEvent event: UIEvent?) {
    if let touch = touches.first {
        let position :CGPoint = touch.locationInView(view)
        startX = Int(position.x)
        startY = Int(position.y)        
    }
}
</code></pre>

<p>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 <strong><code>UIPanGestureRecognizer</code></strong>. </p>

<p>There must be some way to make it in as few lines as getting the starting coordinates.</p>

<p>Can anyone help point me in the right direction?</p>

<p>Best regards, Niklas</p>