Questions tagged [uiswipegesturerecognizer]

UISwipeGestureRecognizer is a concrete subclass of UIGestureRecognizer that looks for swiping gestures in one or more directions. A swipe is a discrete gesture, and thus the associated action message is sent only once per gesture.

UISwipeGestureRecognizer recognizes a swipe when the specified number of touches (numberOfTouchesRequired) have moved mostly in an allowable direction (direction) far enough to be considered a swipe. Swipes can be slow or fast. A slow swipe requires high directional precision but a small distance; a fast swipe requires low directional precision but a large distance.

You may determine the location where a swipe began by calling the UIGestureRecognizer methods locationInView: and locationOfTouch:inView:. The former method gives you the centroid if more than one touch was involved in the gesture; the latter gives the location of a particular touch.

Whole document - UISwipeGestureRecognizer

531 questions
132
votes
17 answers

How to recognize swipe in all 4 directions

I need to use swipe to recognize swipe gesture down and then right. But on swift UISwipeGestureRecognizer has predeterminate Right direction.. And I don't know how make this for use other directions..
user3739367
  • 3,591
  • 6
  • 16
  • 17
131
votes
12 answers

Setting direction for UISwipeGestureRecognizer

I want to add simple swipe gesture recognition to my view based iPhone project. Gestures in all directions (right, down, left, up) should be recognized. It is stated in the docs for UISwipeGestureRecognizer: You may specify multiple directions by…
sandisn
  • 1,313
  • 2
  • 9
  • 5
75
votes
13 answers

How to enable swipe to delete cell in a TableView?

I have a UIViewController that implements TableViews delegate and datasource protocols. Now I want to add "swipe to delete" gesture to cells. How should I go about it. I have given a blank implementation of commitEditingStyle method and also set the…
Amogh Talpallikar
  • 11,754
  • 12
  • 71
  • 131
26
votes
8 answers

How to recognize swipe in all 4 directions?

I need to recognize swipes in all directions (Up/Down/Left/Right). Not simultaneously, but I need to recognize them. I tried: UISwipeGestureRecognizer *Swipe = [[UISwipeGestureRecognizer alloc] initWithTarget:self…
elp
  • 7,607
  • 7
  • 58
  • 113
22
votes
4 answers

how detect swipe gesture direction?

i need to detect direction of my swipe gesture and i've got problem with it. gesture is working, but i don't know how to detect direction. ... swipeGesture = [[UISwipeGestureRecognizer alloc] initWithTarget:self…
18
votes
7 answers

SwiperefreshLayout in Android

i am using SwipeRefreshLayout in my below layout:
13
votes
3 answers

How to add Swipe Gestures to UITableView cell?

I added this code in cellForRowAtIndexPath UISwipeGestureRecognizer *gestureR = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(handleSwipeFrom:)]; [gestureR…
12
votes
3 answers

Is there any priority condition between gesture methods (Pan Gesture and Swipe Gesture)?

I am developing an application where I have used the Pan Gesture as well as Swipe Gesture. So every time I do the Swipe Gesture but the method from the Pan Gesture is always getting called and Swipe Gesture method is not getting called. Is there any…
9
votes
2 answers

Detect swiping in UICollectionView

I need to perform a specific action when the user swipes the uicollectionview. I built it in a way that each cell captures the full screen. I tried those ways: A. scrollViewDidEndDecelerating # pragma UIScrollView -…
Dejell
  • 12,840
  • 37
  • 129
  • 217
8
votes
1 answer

UIKit UISwipeGestureRecognizer in Xcode crashes app during nib loading?

I've added a UISwipeGestureRecognizer to my Xcode nib and having it there makes my app crash with: ..exception 'NSInvalidArgumentException', reason: '-[UISwipeGestureRecognizer initWithCoder:]: unrecognized selector sent to instance…
Nektarios
  • 9,551
  • 7
  • 57
  • 91
8
votes
4 answers

Swipe gesture for back/forward in UIWebView?

I have a WebView in my app. Because it is a tabbed application I'm not able to add buttons for going back/forward on the website. I want to go back/forward by swiping. Right swipe from the left side/edge is back… like in Safari browser for iOS. How…
user4428017
8
votes
6 answers

switching view controllers using swipe gestures

Okay so here is the problem I'm running into: I am attempting to switch from one viewController that I named MenuViewController which contains my menu (obviously). I have a separate viewController named ViewController that contains my mapView. I…
7
votes
3 answers

UITableView swipe gesture conflicts with UITableViewCell swipe

Following is the code I have written to put 2 finger swipe on UITableView : UISwipeGestureRecognizer *leftSwipe = [UISwipeGestureRecognizer new]; [leftSwipe addTarget:self action:@selector(nextDay)]; leftSwipe.numberOfTouchesRequired =…
Nitish
  • 13,002
  • 23
  • 121
  • 243
7
votes
2 answers

swift : show another view controller on swipe up in first view controller

Hi I checked many questions regarding swiping in SO but have doubts . In my app I have two pages 1. user view controller 2. question view controller user page looks like this now what i want to implement is to show questions view controller while…
varun aaruru
  • 2,770
  • 1
  • 16
  • 36
7
votes
1 answer

Recognize two fingers swipe down gesture in UITableView

I want to add two fingers swipe up and down gestures in UITableView. The idea is to scroll through the cells using one finger pan gesture and do some other action by using two fingers swipe up/down gestures. I'd like to achieve a similar experience…
1
2 3
35 36