Questions tagged [uipangesturerecognizer]

UIPanGestureRecognizer is a concrete subclass of UIGestureRecognizer that looks for panning (dragging) gestures. The user must be pressing one or more fingers on a view while they pan it. Clients implementing the action method for this gesture recognizer can ask it for the current translation and velocity of the gesture.

A panning gesture is continuous. It begins (UIGestureRecognizerStateBegan) when the minimum number of fingers allowed (minimumNumberOfTouches) has moved enough to be considered a pan. It changes (UIGestureRecognizerStateChanged) when a finger moves while at least the minimum number of fingers are pressed down. It ends (UIGestureRecognizerStateEnded) when all fingers are lifted.

Clients of this class can, in their action methods, query the UIPanGestureRecognizer object for the current translation of the gesture (translationInView:) and the velocity of the translation (velocityInView:). They can specify the view whose coordinate system should be used for the translation and velocity values. Clients may also reset the translation to a desired value.

Whole document - UIPanGestureRecognizer

1066 questions
9
votes
4 answers

Conflict between ScrollView pan gesture and panGestureRecognizer

I have a UIScrollView in a UIViewController, which is showed modally by a segue, and an additional UIPanGestureRecognizer do dismiss the view controller by pan. This gesture only works if scrollView.contentOffset.y == 0 The problem is, now two…
Tigran Iskandaryan
  • 1,371
  • 2
  • 14
  • 41
9
votes
2 answers

Detect collision of two UIView's in swift

I have two UIViews on my ViewController. I added panGesture to first view and when i start moving this view the second view will move towards first view. I want to detect an event when these two views collides. Here is my code. @IBAction func…
Rakesh
  • 1,177
  • 1
  • 15
  • 31
9
votes
2 answers

implement Facebook messenger style pan to full screen view similar effect

I have implemented UIPageviewContoller to support multiple viewcontoller view at half bottom of my screen. now my question is how to support Facebook style panning effect to on of this subview on my pageview controller. I want to achieve Facebook…
9
votes
1 answer

Why when I change the image of the UIImageView while panning the cell does the whole view reset for a second?

Here's a video of it happening: http://cl.ly/3V0D3U1m3w0E Basically, if I change the image property of the UIImageView (the X) while I'm panning it brings all the controls in the view back to their original, unpanned position. (They're all embedded…
Doug Smith
  • 29,668
  • 57
  • 204
  • 388
9
votes
3 answers

Horizontal scrolling UIScrollView with vertical pan gesture

I am attempting to implement a UIScrollView where horizontally panning scrolls through pictures in the scrollview but vertically panning performs another action I have. Right now I have a UIScrollView that is paginated with vertical scrolling…
lramirez135
  • 2,872
  • 3
  • 18
  • 18
8
votes
4 answers

Scrolling is disabled when adding UIPanGestureRecognizer to UIScrollView

I have a scroll view and I want to make it disappear whenever a pan is done. It works fine and on panning the scroll view disappears but the problem is now I can't scroll the contents. [UIView animateWithDuration:0.2 …
Shubham
  • 785
  • 2
  • 9
  • 14
8
votes
0 answers

UIPanGestureRecognizer velocity return 0 in Simulator Macbook M1

Currently, I am building an app that contains a feature that uses a UIPanGestureRecognizer. Previously, I used an Intel Mac, and the UIPanGestureRecognizer velocity attribute is working correctly and return the expected value. However, after I…
8
votes
2 answers

UIScrollView on tvOS

The question is very simple, how to enable scroll and zoom inside a UIScrollView in tvOS? I tried the same initializer code from iOS and returned the scrollview for the focusedView var, but nothing happens when i touch the remote. Also, i tried to…
8
votes
1 answer

How to use UIGestureRecognizerDelegate?

My Setup I'm trying to replicate Google Now's card interface. I have a UIView which is a subview of (inside) a UIScrollView. Both are controlled from the same UIViewController. The UIView has a UIPanGestureRecognizer attached to it by the…
8
votes
3 answers

Get Swipe to Delete on UITableView to Work With UIPanGestureRecognizer

I have a UIPanGuestureRecognizer added to the entire view using this code: UIPanGestureRecognizer *pgr = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(panAction:)]; [[self view] addGestureRecognizer:pgr]; Within the main view…
carloabelli
  • 4,289
  • 3
  • 43
  • 70
8
votes
1 answer

Making a slide up view similar to the new Google Maps iOS app, troubles with multiple UIPanGestureRecognizer

I am trying to reproduce the behaviour of the slide up menu of the new iOS Google Maps application. So basically it's a view that you can slide up with panning up to a certain point or slide down to a certain point. This view can also with sliding…
7
votes
0 answers

Drag and Drop Image from UICollectionView to UIView?

Is it possible to drag an image from a collectionViewCell into a UIView? I am creating a game where the user can pick a number of items to play with in the next VC. I'm representing each item as an image and the user can select each item by…
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…
7
votes
3 answers

How to disable scroll in a specific subview of a UIScrollView

I have a UIScrollView which contains many subviews. One of the subview is designed to show a linechart, so the user may need to drag horizontally. The truth is when I mean to drag my finger horizontally, the vertical scroll of the UIScrollView is…
Desmond
  • 767
  • 1
  • 6
  • 18
7
votes
3 answers

Passing touch info to UIScrollView under another UIView

I have a UIScrollView under a transparant UIView. I need to transfer all pans and taps to the scroll view (which only scrolls horizontally). The regular UIView uses a subclass of UIPanGestureRecognizer to track vertical pans (Subclass found here).…
Brandon Mcq
  • 575
  • 2
  • 10
  • 24
1 2
3
70 71