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
3
votes
1 answer

How to simulate "pinch out" gesture programmatically?

I am developing a iOS app. I add an UIPinchGestureRecognizer to listen the pinch out action. [[self view]addGestureRecognizer:[[UIPinchGestureRecognizer alloc] initWithTarget:self…
Dragon warrior
  • 1,644
  • 2
  • 24
  • 37
3
votes
2 answers

how can i make zoom like in google maps

im developing a game with some game field, which is drawn in some view. My game field always drawing relative to his center, so i have just simple pinch - (void)pinch:(UIPinchGestureRecognizer *)gesture { if ((gesture.state ==…
east
  • 193
  • 1
  • 6
3
votes
0 answers

iOS add Rotation gesture along with Pinch/Zoom

I am setting up my recognizers like this. Note that although I'm adding the recognizers to self.view, it is actually self.container that is getting transformed (which is a subview). UIPinchGestureRecognizer *twoFingerPinch =…
soleil
  • 12,133
  • 33
  • 112
  • 183
2
votes
1 answer

Unexpected behavior in scaling CAShapeLayer

I am using the following code to scale a CAShapelayer instance (i.e., self.view.layer.sublayers![0]): class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() self.view = Map(frame: CGRect(x: 0, y: 0,…
2
votes
0 answers

How to handle Pinch and Pan Gesture UIView inside UIScrollview?

could anyone tell me how to handle Pinch and pan gesture UIView inside UIScrollview. I have to display both 2 videos at the same time and can use pan and pinch gesture on it.So I keep both AVPlayer on each of its UIView. Then I put that UIView…
2
votes
1 answer

AVCaptureDevice videoZoomFactor Pinch-to-Zoom Rate

I am trying to implement 'Pinch-to-Zoom' feature with AVCaptureDevice in AVFoundation: @IBAction func pinchGestureDetected(_ gestureRecognizer: UIPinchGestureRecognizer) { switch gestureRecognizer.state { case .began: print…
Gizmodo
  • 3,151
  • 7
  • 45
  • 92
2
votes
1 answer

What is scale and why do I have to reset it when using UIPinchGestureRecognizer?

I'm trying to create a resizable face with UIPinchGestureRecognizer. All the tutorials online tell me to always reset the scale to 1, such as this code: func changeScale(byReactingTo pinchRecognizer: UIPinchGestureRecognizer) { switch…
Luke Yuan
  • 25
  • 5
2
votes
0 answers

Uipinchgesturerecognizer zoom image with specific location (Not from Center) - IOS

I want to zoom image using pinch gesture zoom image with specific location/coordinate (Not from center). I don't want to use scrollview, because of when i zoom image with specific location at that time user can drag image also, so i want to stop…
AtulParmar
  • 4,358
  • 1
  • 24
  • 45
2
votes
1 answer

How do i pinch to zoom the entire screen (including labels, buttons and images)? IOS, Swift 3

This code doesn't seem to work. wondering what I'm doing wrong/missing. I assume that I: drag and drop the UIPinchGestureRecognizer to the viewcontroller (so that it doesn't interfere with the connections to buttons, label etc. and it is connected…
MontgommeryJR
  • 255
  • 3
  • 18
2
votes
1 answer

Smoothing out zoom with limits in Spritekit

I've been working on adding zooming functionality to my project via an SKCameraNode and a pinch recognizer. My camera node is overlooking the mainMap node that contains my game and I would like to have limited zoom capability. In my function handler…
Aleksandr
  • 533
  • 1
  • 4
  • 12
2
votes
1 answer

What is the best way to zoom and deplace nodes?

I'm working with Swift 3, SpriteKit and Xcode. So I have a node named backgroundNode, and I attach every nodes of my game to this backgroundNode. Now I would like to be able to zoom on my game with a pinch gesture, and when I'm zoomed in to navigate…
Drakalex
  • 1,488
  • 3
  • 19
  • 39
2
votes
1 answer

iOS: recognize pinch gestures but not two finger pans?

The goal is to only let pinch gestures get recognized if a two-finger pan is not in process. This code allows both pinchGesture and two-finger panGestures, but they occur at the same time. This was based off this answer to use the…
Crashalot
  • 33,605
  • 61
  • 269
  • 439
2
votes
1 answer

Zoom in and Zoom out on Camera View Using Objective-C?

How to Apply Zoom in and Zoom out On Camera view Using UIPinchGestureRecognizer and AVCaptureDevice. It is Not Zooming properly. Zoom Out is Not Working in My below Code : AVCaptureDevice *device =[AVCaptureDevice defaultDeviceWithMediaType: …
kishor
  • 221
  • 2
  • 14
2
votes
2 answers

how to prevent view to exceed its parent bounds on Pinch Gesture - swift

I assigned the pinch gesture to uiview: myView.addGestureRecognizer(UIPinchGestureRecognizer(target: self, action: "handlePinch:")) This function will scale the uiview: func handlePinch(recognizer : UIPinchGestureRecognizer) { if let view =…
MBH
  • 16,271
  • 19
  • 99
  • 149
2
votes
1 answer

Set content size of scrollview relative to transform on zooming by UIPinchGestureRecognizer

I have scrollview and added UIPinchGestureRecognizer to scrollview. Now on gesture event I have zoom in or out scrollview and its handle action is as following : static float lastScale = 1.0; - (void)handlePinchGesture:(UIPinchGestureRecognizer…
VRAwesome
  • 4,721
  • 5
  • 27
  • 52