Questions tagged [uipinchgesturerecognizer]

UIPinchGestureRecognizer is a concrete subclass of UIGestureRecognizer that looks for pinching gestures involving two touches.

When the user moves the two fingers toward each other, the conventional meaning is zoom-out; when the user moves the two fingers away from each other, the conventional meaning is zoom-in.

Pinching is a continuous gesture. The gesture begins (UIGestureRecognizerStateBegan) when the two touches have moved enough to be considered a pinch gesture. The gesture changes (UIGestureRecognizerStateChanged) when a finger moves (with both fingers remaining pressed). The gesture ends (UIGestureRecognizerStateEnded) when both fingers lift from the view.

Whole document - UIPinchGestureRecognizer

248 questions
4
votes
1 answer

How can I use the UIPinchGestureRecognizer with the entire view to zoom the entire screen? Swift 3, IOS

I can't seem to connect my action (pinch gesture) to my view, instead it connects to the viewcontroller. This is everything i have coded in the view controller to test out the code: import UIKit class AlertController: UIAlertController…
MontgommeryJR
  • 255
  • 3
  • 18
4
votes
1 answer

How to limit zooming in SpriteKit

I have a Swift + SpriteKit app that loads an SKSpriteNode onto a scene, registers a UIPinchGestureRecognizer, and handles that pinch gesture with a simple handler function, like so: func zoom(_ sender: UIPinchGestureRecognizer) { // Don't let…
zeeple
  • 5,509
  • 12
  • 43
  • 71
4
votes
3 answers

ios - pinch/zoom an image, centered on touches

I can get pinch/zoom functionality working like this: - (void)twoFingerPinch:(UIPinchGestureRecognizer *)recognizer { if([recognizer state] == UIGestureRecognizerStateBegan) { _lastScale = 1.0; } CGFloat scale = 1.0 -…
4
votes
3 answers

Is there a gesture recognizer that handles both pinch and pan together?

So I am working with the iOS 4.2 to add zoom and pan to my application. I have implemented an instance of the UIPinchGestureRecognizer and UIPanGestureRecognizer. It seems to me that only one of these is recognizing a gesture at a time. In…
user574771
  • 999
  • 2
  • 10
  • 20
4
votes
2 answers

Why does panning let the user move the zoomed view outside the superview?

I am working on pinch in and pinch out feature on pdf pages. My pinch in and panning(moving) is working properly, but when user continuously moves the zoomed view, the zoom view goes outside the super view bounds.Something like this: how can i…
3
votes
5 answers

How to zoom in/out only any one particular cell of a table view not the whole table?

I want to zoom in/out only any one particular row/cell of table view not the whole table. I have used pinch gesture but its not working on table cell its working on whole table. i need to zoom one cell at a time and when I want to zoom 2nd cell…
Archana Chaurasia
  • 1,396
  • 3
  • 19
  • 35
3
votes
1 answer

How to limit Max/Min Scale of Pinch Zoom in UIPinchGestureRecognizer

How would I be able to limit the scale of the UIPinchGestureRecognizer to a min and max level? (not using UIScrollView) I would like to set max size as image width and hight. var pichCenter : CGPoint! var touchPoint1 : CGPoint! var touchPoint2 :…
Ryoma Kishimoto
  • 425
  • 1
  • 6
  • 16
3
votes
2 answers

UILabel blurred text using UIPinchGestureRecognizer

I have a UILabel; when I enlarge it using UIPinchGestureRecognizer, the text becomes blurred. I use CGAffineTransformScale my code self.myLabel.transform = CGAffineTransformScale(self.myLabel.transform, pinchRecognizer.scale,…
Alisher
  • 89
  • 1
  • 7
3
votes
1 answer

How to detect or define the orientation of a pinch gesture with UIPinchGestureRecognizer?

I'm using UIPinchGestureRecognizer to detect pinch gestures, something like: - (void) initPinchRecon { UIPinchGestureRecognizer *pinchRecognizer = [[[UIPinchGestureRecognizer alloc] initWithTarget:self …
José Joel.
  • 2,040
  • 6
  • 28
  • 46
3
votes
0 answers

Camera Zoom is Working For iPhone But Not Working for iPad

I am working on iOS-Cordova cross platform. I am accessing Camera API com.mbppower.camerapreview from github. I want to Zoom in and Zoom Out my camera and Want to capture image Through Native iOS Class , My Code is working for iPhone But not…
kishor
  • 221
  • 2
  • 14
3
votes
1 answer

Scaling a UIView along one direction with UIPinchGestureRecognizer

In my app I have a draggable UIView to which I have added a UIPinchGestureRecognizer. Following this tutorial, as default the view is scaled along both x and y directions. Is it possibile to scale along only one direction using one finger? I mean,…
SagittariusA
  • 5,289
  • 15
  • 73
  • 127
3
votes
0 answers

UIPinchGestureRecognizer does not get past Possible state

I have required init?(coder aDecoder: NSCoder) { super.init(coder: aDecoder) self.multipleTouchEnabled = true let pinchRecognizer = UIPinchGestureRecognizer(target: self, action: "handlePinch:") …
Joshua Goossen
  • 1,714
  • 1
  • 17
  • 36
3
votes
1 answer

Pinch gesture scale resetting to 1?

I was looking at this repo https://github.com/mmohsin991/gestures/blob/master/gestures/ViewController.swift and this example http://www.raywenderlich.com/50398/opengl-es-transformations-gestures I have the following code @IBOutlet var…
3
votes
1 answer

UIPinchGestureRecognizer zooming AVCaptureConnection; not scaling down

I have a problem, I have a UIPinchGestureRecognizer that I'm using to scale my camera preview and respective AVCaptureConnection in and out. There is no problem in zooming in and out the first time until you lift your fingers after you're done…
3
votes
1 answer

How to reset zoom for UIWebView in IOS

I have an UIWebView with scalesPageToFit = YES and contentMode = UIViewContentModeScaleToFill and it zooms automatically to fit my UIWebView size after page loads. I can zoom in with pinch gesture but then I cannot reset the zoom by code to it's…
user1620350
1 2
3
16 17