How to set more directions for UISwipeGestureRecognizer?
UISwipeGestureRecognizer
has four directions that I can set开发者_Go百科: up, down, right, left.
but as I tried to set, the direction of a swipe seems need to be quite precise. I mean, for example, if I set a UISwipeGestureRecognizer
with toUp direction, and if I swipe my finger not that precise toUp, say 45 degree in the middle of up and right, the UISwipeGestureRecognizer
can't get it.
But I noticed that for UIScrollView
, it is not the case.
So How can I give more directions for UISwipeGestureRecognizer
or how can I make the direction check more relax?
Thanks
It's probably best to use Apple's swipe gesture to be consistent with their Apps. You could try defining your own by subclassing the UISwipeGestureRecognizer, or creating your own class using the older UITouchesBegan, UITouchesEnded, etc methods.
精彩评论