views:

74

answers:

1

Hello,

I'm using UISwipeGestureRecognizer successfully to capture and action when gestures on the screen are made with single or multiple touches in Up, down left or right directions using the standard tools.

However what I really need to do now is have the device recognize diagonal swipes in the same way. Does anyone have any ideas where to start? Do I simply subclass UIGestureRecognizer myself and try to work out how to roll my own UIDiagonalSwipeRecognizer? Or is there a way of detecting if a swipe is, say, up && left?

Your help is appreciated...

+1  A: 

I'd simply use an oldschool "touchesBegan" and "touchesEnded" and there check the x and y delta, if both of them is greater then some minimum constant, then this swipe should be a diagonal one.

Correct me if I wrong but UISwipeGestureRecognizer available from iOS 3.2 only, and if so that is not an advantage.

NR4TR
You're quite right, but no worry for the app is for the 4.0 and above crowd. Your suggestion got me reading and discussing and I think it's the way forward. Many thanks.
MightyLeader