How do i put a swipe gesture in the new iPhone SDK? I'm trying to detect a swipe gesture over a UIImageView? A swipe up and a swipe down?
A:
Basically you need to override onTouchesBegan and onTouchesEnded. When it begins, record the first position, then at the end compare the last touch to the first touch to see if it is lower or higher.
Matt Williamson
2010-08-12 03:14:45
This really is _not_ the way to do it. Since he's using iOS4 he can use the new `UIGestureRecognizer` which were made for this purpose. Ohmu's answer is better suited.
Yannick Compernol
2010-09-28 09:19:38
Ah. That's helpful. Thanks.
Matt Williamson
2010-09-29 02:28:10