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
2
votes
0 answers

How to add pinch Gesture to scale circle drawed by UIBezierPath

I have created circle in my app as bellow UIBezierPath *circle = [UIBezierPath bezierPathWithOvalInRect:bounds]; Now problem is that I need to apply pinch gesture to scale in and out circle. I have stucked with this issue. Please give guidance in…
Rajesh
  • 948
  • 7
  • 13
2
votes
1 answer

UIPinchGestureRecognizer to resize custom UIView

I created a custom UIView and I am trying to have UIPinchGestureRecognizer handle the resize of it. But when I test my code the text is being resized when pinch and the frame is still the same size. in floatingToolbar.m -(void)…
sfbarry14
  • 61
  • 5
2
votes
1 answer

Zoom on a two dimensional UICollectionView

I created a UICollectionView which is horizontal and vertically. It has different UICollectionViewCells. Everything is layouted correctly. Now I am trying to make it zoomable. The UICollectionViewCells are resized correctly too. Every time the…
2
votes
1 answer

on pinch, image view shifts back to original frame's origin even after pan to different location

When scaling an image view using the UIPinchGestureRecognizer when the action is ongoing the image "tries" to remain at the initial frame.origin. Even after a pan gesture has moved the image to another location a pinch promptly moves it back to…
dotKwame
  • 181
  • 3
  • 13
2
votes
2 answers

Issue scaling layer at the center of a pinch gesture

I am currently having a map(tilemap) within a layer that i would like to pan/zoom using the following code: - (void) pinchGestureUpdated: (UIPinchGestureRecognizer *) recognizer { if([recognizer state] == UIGestureRecognizerStateBegan) { …
tiguero
  • 11,477
  • 5
  • 43
  • 61
2
votes
3 answers

Use UIPinchGestureRecognizer to scale view in direction of pinch

I needed a Pinch Recognizer that would scale in x, or y, or both directions depending on the direction of the pinch. I looked through many of the of the other questions here and they only had parts of the answer. Here's my complete solution that…
Scott
  • 652
  • 1
  • 7
  • 15
2
votes
1 answer

How can I use pinch zoom(UIPinchGestureRecognizer) to change width of a UIView

I can get the UIPinchGestureRecognizer handler to work with scaling an object but I don't want to scale I want to change the size. For example I have a UIView and I've attacked a UIPinchGestureRecognizer gesture to it and if the user pinches I want…
2
votes
1 answer

UIPinchGestureRecognizer inwards pinch "slower"

I'm using UIPinchGestureRecognizer in my app to zoom in on a view (and yes, there's a reason I'm not using UIScrollView). When I pinch outwards with my fingers, the view zooms in as expected, and if I then reverse pinch without taking my fingers off…
2
votes
0 answers

UIScrollView zoom behaviour WITHOUT scaling subviews

So I have a UIScrollView with the zooming functionality delegated to a view controller which of course overrides: - (UIView*)viewForZoomingInScrollView:(UIScrollView*)scrollView { ... etc ... and everything works (it zooms and scrolls). Then I took…
2
votes
2 answers

Pinch zooming a UIScrollView on the x-axis only

I want to be able to pinch zoom on a UIScrollView, so that subviews expand/contract on the the x-axis only. I create a UIScrollView, and using addSubview to add the UIViews. Each UIView has a UILabel in it. Should I be holding on to these UIViews…
1
vote
1 answer

iPhone iOS how to make UIScrollView work with UIRotationGestureRecognizer when zooming is enabled?

I'm working in iOS5, and apparently I should be able to control or at least subdue the UIScrollView's internal pinch gesture recognizer using scrollView.pinchGestureRecognizer. However, my code does not seem to work. The recognizer does not treat my…
Alex Stone
  • 46,408
  • 55
  • 231
  • 407
1
vote
2 answers

UISegmentedControl - Changing Colors and Size - Not working Right

I want to be able to Change the Colors and font size of the Segments of a UISegmentedControl. I'm setting the tag for each segment and then setting the tintColor: forTag: for each of the segments. Changing the Colors works great, till I pan the…
scooter133
  • 1,297
  • 1
  • 15
  • 29
1
vote
1 answer

Proportionally scaling UIPanGesture actions to zoom level in a SpriteKit scene

I have a SpriteKit scene in my iOS app that makes use of both pan and pinch gestures - panning for moving the view of the scene's camera, and and pinch gestures for zooming in and out of the scene by scaling the scene's camera. Zooming works…
1
vote
2 answers

How do restrict pan gesture recognizers to when a pinch gesture is occurring?

How do you only accept pan gestures when the user is in the process of a pinch gesture? In other words, I'd like to avoid delivering one finger pan gestures. @IBAction func pinchPiece(_ pinchGestureRecognizer: UIPinchGestureRecognizer) { guard…
Curiosity
  • 544
  • 1
  • 15
  • 29
1
vote
2 answers

how to get the coordinate of pinchgesture in iphone

I am working on UIPinchGesture its working fine. I want to find the coordinate of image(x,y,width,height) when shrink and large every time. My code is: -(IBAction) handlePinchGesture:(UIGestureRecognizer *) sender { CGFloat factor =…