I need to know that a user started to touch the screen and then know when he is not touching it anymore.
With touchesBegan and touchesEnded I can get such information. However, if the user is swiping his fingers, then I know he started doing it with touchesMoved.
However I am not able to check when he is no longer touching the screen.
Basically , touchesEnded will not fire after the user stopped swipping.
Any ideas?
Example of my code:
override func touchesBegan(touches: Set<UITouch>, withEvent event: UIEvent?) {
if let touch = touches.first {
print("Finger touched!")
}
super.touchesBegan(touches, withEvent:event)
}
override func touchesMoved(touches: Set<UITouch>, withEvent event: UIEvent?) {
if let touch = touches.first {
print("Finger is swipping!")
}
super.touchesBegan(touches, withEvent:event)
}
override func touchesEnded(touches: Set<UITouch>, withEvent event: UIEvent?) {
if let touch = touches.first {
print("finger is not touching.") //this will not fire if finger stopped swipping
}
super.touchesBegan(touches, withEvent:event)
}