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

537 questions
3
votes
1 answer

How do I detect when a user swipes in a certain direction on a specific node?

I have different 6 colored circles falling from the top of my screen. With each node, you are supposed to swipe in a different direction to score a point(red circle; swipe up, blue circle; swipe down, etc) but if the user swipes in a different…
KeepItSimple
  • 133
  • 8
3
votes
1 answer

How to add swipe gesture to segmented control?

I have an ImageView added to UIView. Tapping on the image take to Segmented Control which is also part of same UIView. I am trying to add swipe gestures to this segmented control. Tried following. override func viewDidLoad() { …
3
votes
1 answer

Swift Call A Function When Swipe Gesture Ends

I have a swipe gesture recogniser in my app, but how can I call a function every time the swipe ends (i.e. call when the user finish swiping and lift up his/her finger)? Thanks.
hklel
  • 1,624
  • 23
  • 45
3
votes
0 answers

iOS UISwipeGestureRecognizer working intermittently - Swift/Xcode

I am setting up a UISwipeGestureRecognizer for an UIImageView on my ViewController.swift file but my manual swipe on my iPhone only works 1 out of 10 times, if that. Do I only need one GestureRecognizer for the directions of left/right? Or did I…
pmoney13
  • 1,075
  • 3
  • 11
  • 19
3
votes
0 answers

how to handle two type right swipe gestures

In my project i have created a UIView (red view) and given a swipe gestures(right & left) to it. Its working fine and then i kept a slide out slide bar menu. Now i am facing problem. If i swipe left the red view is going fine. when i swipe right…
iSekhar
  • 119
  • 1
  • 8
3
votes
4 answers

iOS: How to add swipe to delete button to a custom view in viewForHeaderInSection

There is a expand-collapse like table view with custom header using viewForHeaderInSection. In that, I want to add swipe gesture functionality to delete the same view i.e section header. My code for viewForHeaderInSection is, - (UIView…
iOSNoob
  • 1,420
  • 2
  • 16
  • 30
3
votes
1 answer

UISwipeGestureRecognizer extra argument 'target' in call for Archive project but not for Build project

If I Archive my project I receive Extra argument in 'target' in call but I do not receive this error if I Build the project. If I remove the target parameter name then I receive an error if I build. let rightSwipeGestureRecognizer:…
mobileDev97
  • 121
  • 6
3
votes
3 answers

How to animate left/right swipe view using UISwipeGestureRecognizer

try to make swipe in single-view and it's working but not get animation and page indicatore bubble in bottom - (void)viewDidLoad { [super viewDidLoad]; UISwipeGestureRecognizer *swipeleft = [[UISwipeGestureRecognizer alloc]initWithTarget:self…
Ujesh Patel
  • 33
  • 1
  • 6
3
votes
1 answer

UIScreenEdgePanGestureRecognizer to activate SWRevealViewController pan gesture

I am using SWRevealViewController for sidebars and I have to use swipe for my previous and next stories and edge pan for sidebars. The reason I use UIScreenEdgePanGestureRecognizer instead of PanGestureRecogniser is because swipe will end up call…
3
votes
2 answers

select text from UItextView by swipe

I have a UITextView with some texts. I need to select the text by swiping on textview. I mean when we swipe on the content of textview it should be selected and want to get that string to assign to a NSString object. is there any method to achieve…
3
votes
2 answers

SpriteKit and UISwipeGestureRecognizer

In my viewDidLoad function, I setup a swipe gesture recognizer: var swipeRecognizer:UISwipeGestureRecognizer = UISwipeGestureRecognizer(target: self, action: Selector("move")) swipeRecognizer.direction =…
codevinsky
  • 1,273
  • 1
  • 9
  • 18
3
votes
1 answer

UISwipeGestureRecognizer diagonal swipe issue

Well, I have some code to add 4 recognizers to a view, like this - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib for(int d = UISwipeGestureRecognizerDirectionRight; d <=…
phyrrus9
  • 1,441
  • 11
  • 26
3
votes
4 answers

Forward horizontal swipe events on UITableView to parent view

I have a UITableView that I want to have respond to taps and vertical swipes, but still have something like userInteractionEnabled = NO for horizontal swipes. By that I mean, it would not handle touches and pass the touch event back to its…
3
votes
1 answer

How to increase the vertical movement tolerance of horizontal UISwipeGestureRecognizer?

I implemented a horizontal UIScrollView with few different sections for individual page and each sections are implemented as UITableView to be scrolled vertically. How to increase the vertical movement tolerance of horizontal…
3
votes
0 answers

How to implement gmail like Achieve or Undo action in a list item

I need to implement gmail like swipe action on a list item in my listview. I am able to implement swipe on the list item, but how can remove the existing view and change to another view.How can I Archieve my message similar to gmail ? Please help me…