I need to use view swipe gesture down, up, left and then right. But on swift UISwipeGestureRecognizer
has predeterminate right direction. And I don't know how make this for use other directions.
Asked
Active
Viewed 347 times
0

Opal
- 81,889
- 28
- 189
- 210

Krishnaveni
- 34
- 2
-
http://stackoverflow.com/questions/24215117/how-to-recognize-swipe-in-all-4-directions you can check this page. It worked on me. – slytrkmn Nov 30 '16 at 17:22
1 Answers
0
You can achieve different swipe direction using code and Storyboard as well.
Using Code
var swipeLeft = UISwipeGestureRecognizer() swipeLeft.direction = UISwipeGestureRecognizerDirection.Left //Use following Directions as you need //UISwipeGestureRecognizerDirection.Right //UISwipeGestureRecognizerDirection.Up //UISwipeGestureRecognizerDirection.Left
Using Storyboard:
Select the gesture and in Attribute Inspector select the direction. see the screen shot.
Note: You will need 4 different gesture recognisers for 4 directions

Vivek Molkar
- 3,910
- 1
- 34
- 46