iOS GestureRecognizers All Directions -
I am quite new to iOS development. I have only started one or two months ago. I have an idea for an application, but it will require gesture recouilers. I have searched the document for the gesture recognizer but as far as I can tell, it can only detect 4 directions, write some code above, left, right and down anyway that gives you the user's swipe any direction Will find out. For example, if users want to swipe to the upper-right direction or the bottom-right direction, then is there any way to detect it?
EDIT: After thinking about this, I have come in a better way to explain to who I want a code for if I was developing a game for iOS and the user usually has the camera Are visible in the scene (bird-eye scenes) and I wanted to permit them to move their views in a map so that they could see the basis of an enemy base or their allies, Do not be put simply, top right, to the left and swipe those diagonal instead of swiping down know?
I think you are a little confused.
But then UISwipeGestureRecognizer is the subclass of UIGestureRecognizer , and, as you say, it only detects swipe for those 4 directions.
UIPanGestureRecognizer , which you can use to detect movement in any direction. This gives you a method called
translationInView: which gives you the change in the direction of your finger in whatever direction.
Comments
Post a Comment