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

1041 questions
13
votes
2 answers

Scale image based off UIPinch

I am so confused with how to do what I need! Any help is very appreciated! I have an transparent image overlay that has another image behind it that has a UIPanGestureRecognizer and a UIPinchGestureRecognizer attached to it. The top image has a…
13
votes
2 answers

Is it possible to do an edge swipe in iOS simulator?

iOS 7 provides for a UIScreenEdgePanGestureRecognizer which detects swipes in from edges of the screen. Can this gesture be simulated using the iOS7 simulator in Xcode? Clicking and dragging outside the screen area just moves the whole simulator…
user2709279
  • 313
  • 3
  • 15
13
votes
2 answers

How to complete interactive UIViewController transition?

I've been dabbling with the new iOS 7 custom transition API and looked through all the tutorials/documentation I could find but I can't seem to figure this stuff out for my specific scenario. So essentially what I'm trying to implement is a…
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…
12
votes
7 answers

unexpected nil window in _UIApplicationHandleEventFromQueueEvent, _windowServerHitTestWindow

I am trying to set up an edge swipe gesture in iOS 8 on iPad but getting and error that seems like a bug. I have the following code: UIScreenEdgePanGestureRecognizer *edgeRecognizer = [[UIScreenEdgePanGestureRecognizer alloc] initWithTarget:self…
motionpotion
  • 2,456
  • 5
  • 38
  • 56
12
votes
1 answer

With UIPanGestureRecognizer, is there a way to only act so often, like after x many pixels were panned?

Right now my UIPanGestureRecognizer recognizes every single pan, which is great and necessary, but as I'm using it as a sliding gesture to increase and decrease a variable's value, within the method I only want to act every so often. If I increment…
user212541
  • 1,798
  • 1
  • 20
  • 29
11
votes
1 answer

Continuous scrolling between UIPanGestureRecognizer and re-enabled UIScrollView

I've got a UIScrollView with paging enabled, and I've added my own UIPanGestureRegonizer to it. Under certain instances, my view controller will set scrollview.scrollEnabled = NO, and then add the pan gesture recognizer to it (I'm not using the…
jbrennan
  • 11,523
  • 14
  • 69
  • 110
11
votes
2 answers

Detect A Pan Gesture in GMSMapView

I have a GMSMapView that allows for a handful of gestures inside of it (pan, zoom, etc). I am trying to implement a Facebook style slide out menu from this view. What is the best way to detect a pan gesture from within this view while still allowing…
10
votes
1 answer

custom interactive transition animation

I want to implement an interactive transition between two view controllers. I would like it to be a modal or present transition. I want the app to start out on the first view controller and allow the user to swipe down to bring in the second view…
Salim
  • 103
  • 1
  • 4
10
votes
3 answers

How to programmatically send a pangesture in swift

I have a view that has panGesture functionality, but I need to send a pan-gesture from one point to another programatically. Is there a way to do this in swift using an animation with a specific time interval? Here is my attempt at calling the pan…
Greg Miller
  • 267
  • 1
  • 3
  • 13
10
votes
2 answers

Capture only UIView 2 finger UIPanGestureRecognizer

I have a couple of UIScrollViews in my view controller. I want to overlay a view that captures a 2 finger swipe via UIPanGestureRecognizer which will not record the UIScrollView swipe gestures. When I put a transparent view over my content with a 2…
Andy Jacobs
  • 14,897
  • 13
  • 57
  • 89
9
votes
3 answers

How to add UIPanGestureRecognizer to UIScrollView subviews

I am adding subviews to a UIScrollView and then I add UIPanGestureRecognizer to these subviews. Everything works fine but now after adding UIPanGestureRecognizer to subviews of the scroll view, scrolling is not possible. What can be the possible…
Shubham
  • 525
  • 2
  • 7
  • 13
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,161
  • 1
  • 9
  • 26
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
  • 27,683
  • 54
  • 189
  • 363
1
2
3
69 70