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
4
votes
5 answers

Swipe gesture interrupts UISlider control in iOS 13, but not previous iOS versions

Note: This is the iOS 13 beta, but also could apply to the official release tomorrow. Update 2: I replaced it with a larger thumb image, and I'm still having a problem. Update: It looks like it still controls continuously if I'm super precise…
Chewie The Chorkie
  • 4,896
  • 9
  • 46
  • 90
4
votes
1 answer

UISwipeGestureRecognizer doesn't recognize swipe gesture initiated outside the view

func addSwipe() { self.isUserInteractionEnabled = true let directions: [UISwipeGestureRecognizerDirection] = [.right, .left] for direction in directions { let gesture = UISwipeGestureRecognizer(target: self, action:…
zs2020
  • 53,766
  • 29
  • 154
  • 219
4
votes
2 answers

call a func from different class in selector

I am using UIGestureRecognizer. I am trying to call a func from different class in the selector, but i am getting NSInvalidArgumentException when it executes. import Foundation import UIKit class helperClass { var onBoardingImageArray :…
Baran Karaoğuz
  • 236
  • 1
  • 12
4
votes
4 answers

UICollectionView Swipe

I want to detect when a user swipes left or right in a collectionView in which one cell occupies the entire screen width. Is it possible to do without adding gesture recognizer. I have tried adding gesture recogniser, but it only works when we set…
user694688
  • 593
  • 1
  • 15
  • 32
4
votes
1 answer

UISwipeGestureRecognizer conflicts with UIScrollView

The view hierarchy is like this: A normal UIView is at the bottom, and a UIScrollView is added on the bottom whose contentSize is equal to the size of the bottom view.Then, a "UISwipeGestureRecognizer" is added on the bottom view whose swipe…
itenyh
  • 1,921
  • 2
  • 23
  • 38
4
votes
3 answers

iOS creating swipe to go back

I want to make a back swipe like the one in iOS 7.I'm still new with the whole iOS development, this is what I'm currently using. Currently I have a pan gesture that detects if the user swipes back and then it just pops the navigation…
3
votes
1 answer

What is the best way to create a custom "tickle" UIGestureRecognizer?

I would like to create a custom UIGestureRecognizer for a "tickle"... in other words, detecting a swipeLeft followed by a swipeRight, twice, without lifting the finger. I know I can create it by starting from scratch with a custom gesture, but then…
3
votes
2 answers

UIScrollView prevent scrolling in one direction regardless of contentSize/Offset

I have a UIScrollView with paging enabled but I would like to be able to prevent the user to swipe to the next page or back to the previous page in some cases. For instance someone could be passing a test with ten questions (one question per page)…
Deratrius
  • 679
  • 10
  • 21
3
votes
2 answers

UISwipeGestureRecognizer and ShareExtension: Different behaviour on iOS 12.4 and 13.0 and latest (bug or undocumented?)

I am creating a Share extension and faced with a strange behaviour during my tests on iOS 13.0 and later. I use UISwipeGestureRecognizer to interpret user's swiping gestures on the main view on my extension. This simple code provides below as an…
3
votes
1 answer

Make The Swipe gesture Animated

i have swipe gesture that switch between tab bars when I swipe in the screen right or left its change the tab bar im in it How would I make it so it looks like it is sliding to the right or left tab bar rather than just instantly changing the tab…
mazenqp
  • 345
  • 4
  • 19
3
votes
1 answer

Swift UISwipeGestureRecognizer how to detect diagonal swipes?

i need to detect all the swipes left swipe and right swipe including the up slide. I mean i need to detect all the swipes in the 180 degrees area, I'm not sure if I'm clear enough. When I add .up .right and .left it does not detect the diagonals…
Atakan Cavuslu
  • 914
  • 1
  • 9
  • 17
3
votes
4 answers

How to create up/down swipeable UITableView?

I have a UITableView in the bottom of UIViewController and tableview height is 100 point now. The tableview has 20 cells and tableview's header view is 100 point. And I've added a up UISwipeGestureRecognizer and a down UISwipeGestureRecognizer in…
RajeshKumar R
  • 15,445
  • 2
  • 38
  • 70
3
votes
2 answers

UITableView can be dragged up and down, not allowing Swipe Gesture?

I am a beginner in Swift, and am trying to add a swipe gesture recognizer to my UIView. I have inserted a gradient CALayer to index 0 to have a gradient background. My problem is: Swipe gestures for right and left work fine, but for Down it doesn't…
Kabir Shah
  • 179
  • 1
  • 2
  • 12
3
votes
2 answers

Swipe Left or Right in swift

I have a page that retrieves data from the database to display info about the current info or previous or after It goes that if Status = 1 it shows the current Status = 2 it shows previous Status = 0 it shows next What I did so far is display the…
MuaathAli
  • 117
  • 4
  • 15
3
votes
2 answers

Swiping left to create a new collectionViewCell

I'm trying to implement a smoother way for a use to add new collectionViewCells for myCollectionView (which only shows one cell at a time). I want it to be something like when the user swipes left and if the user is on the last cell myCollectionView…
1 2
3
35 36