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

How to prevent subview resize when zoom superview with UIPinchGestureRecognizer?

I've a series of cells that resize using a UIPinchGestureRecognizer with something like pinchGesture.view?.transform = (pinchGesture.view?.transform)!.scaledBy(x: deltaScale, y: deltaScale) and it works fine. However, I had some buttons and a label…
stevenpcurtis
  • 1,907
  • 3
  • 21
  • 47
0
votes
1 answer

UIPinchGestureRecognizer doesn't fire after custom UIGestureRecognizer fails

I have a custom UIGestureRecognizer subclass that detects a particular kind of one-finger dragging. On the same scene, I also have a UIPinchGestureRecognizer, that detects two-finger pinches. The problem happens when the user makes a pinch gesture…
Robert
  • 6,660
  • 5
  • 39
  • 62
0
votes
3 answers

Keep zoom centered on UIView center (as opposed to scaling from top left corner)

I am implementing a pinch-based zoom and the scaling occurs from the top left corner of the view as opposed to scaling from the center. After a few attempts (this seems like a cs origin problem or the like), not finding a good solution for this but…
aac
  • 21
  • 4
0
votes
1 answer

Limited Area Pinchview in Swift

I have a label on a imageview and both of them are in one view. The label is pinch-able via below code. However, it is pinch-able also out of image view. I want the areas outside of the imageview not seen (like in whatsapp or snapchat. The texts…
Emre Önder
  • 2,408
  • 2
  • 23
  • 73
0
votes
2 answers

Swift 2: Selector in UIPinchGestureRecognizer: How to access func from another class

I'm following this class on Swift and building apps. At 43:30 in the video, the instructor teaches how to set up a UIPinchGestureRecognizer, which takes in a function from another file in its Selector. This is the code the instructor…
0
votes
3 answers

Gesture Binding limit for pinch gesture IOS

I am using Pinch gesture to zoom out an imageVIew Now can I set the limit that Down to that limit it won't let user to zoom out. I am using below code for that. func handlePinch(recognizer : UIPinchGestureRecognizer) { …
JAck
  • 854
  • 9
  • 18
0
votes
2 answers

UIPinchGestureRecognizer in UIView is not working properly

I am trying to do zoom-in and zoom-out in a UIView using UIPinchGestureRecognizer. But when I do pinch on my trackpad, it is not recognising the pinch and the control is not going to my twoFingerPinch function. I am using the following code. -…
itzmebibin
  • 9,199
  • 8
  • 48
  • 62
0
votes
1 answer

Add an item at a specific location in recycler view without refreshing the recyclerview completely

I need to show a list of data which can be expanded further. Here for showing the list, I've used RecyclerView, but I'm open to use any other widget too. This list should be able to do following tasks: Add an item at any given specific position and…
0
votes
2 answers

ios - UIPinchGestureRecognizer scale UIImageView like snapchat app

I want to scale imageview at minimum size and even the image view is intractable when it's size is around 5*5 or something near. In snapchat Image (sticker) is shrinking at very small size and even it can be intractable to change position and…
0
votes
0 answers

iOS - Control UISlider using UIPinchGestureRecognizer

I currently have a UISlider in my view and I'm trying to change the UISlider value when the user pinch in and out using UIPinchGestureRecognizer. The UISlider name is pinchSlider and the UIPinchGestureRecognizer method name is pinchGesture:. In my…
Swift Learner
  • 103
  • 1
  • 1
  • 11
0
votes
2 answers

pick up all UIGestureRecognizer events in callback?

Is there a way to pickup all UIGestureRecognizer events in one method? (besides via directing all their selectors to the same method). So for example: // Add Gesture Recogniser (Long Press) let longPressGR =…
0
votes
2 answers

Attempting to present <**> on <**> while a presentation is in progress. While performing a segue from one view controller to another using swift

override func viewDidAppear(animated: Bool) { view.userInteractionEnabled = true let pinchGesture:UIPinchGestureRecognizer = UIPinchGestureRecognizer(target: self, action: "pinchGesture") view.addGestureRecognizer(pinchGesture) let…
nikhil.g777
  • 882
  • 3
  • 12
  • 24
0
votes
1 answer

Why I can't set the default zoom on my UIScrollView in my ios swift app?

I have a UIViewController with a UIScrollView on it. I wanted to have a behavior in my app as follows: 1) user opens the app and sees the photo in normal size (default size of the UIScrollView) 2) when user single taps on the photo, it goes to full…
randomuser1
  • 2,733
  • 6
  • 32
  • 68
0
votes
0 answers

Pinch with webkitTextSizeAdjustin UIWebView

I have a problem and not solve! need a "pinch" to zoom in the text of webView, someone help me? I'm doing well, correct? CODE: - (void)handlePinchGesture:(UIPinchGestureRecognizer *)gestureRecognizer { if([gestureRecognizer state] ==…
0
votes
0 answers

how to set the scale center when using UIPinchGestureRecognizer?

I use the code in follow to do the scaling CGAffineTransform currentTransform = self.imageView.transform; CGAffineTransform newTransform = CGAffineTransformScale(currentTransform, sl, sl); [self.imageView setTransform:newTransform]; ,but i found…
AFu
  • 73
  • 6