I'm looking for the final position of touchesEnded
. My touchesBegan
code looks like this:
override func touchesBegan(touches: Set<UITouch>, withEvent event: UIEvent?) {
if let touch = touches.first {
touchStart = touch.locationInNode(self)
print("touchStart_1: \(touchStart)")
}
}
The print gives me the location.
In touchesEnded
, I have the following:
override func touchesEnded(touches: Set<UITouch>, withEvent event: UIEvent?) {
if let touch = touches.first, start = touchStart {
print("touchStart_2: \(touchStart)")
let location = touch.locationInNode(self)
print("touchEnded: \(location)")
}
}
Neither of these prints returns anything. As additional information, I'm using UISwipeGestureRecognizer
as well elsewhere but I understand that gesture recognisers work independently of touches. Any idea what's up?