UIScrollView zoomed won't produce swipe - ios

I have a UIScrollView with zooming enabled, and a swipe gesture recognizer setup. When the user is not zoomed, the swipes come through great, but as soon as the user zooms in, the swipe won't come through.
My swipe recognizer is applied to the imageview, and I have tried to apply it to the scroller also. When zoomed, no go.
Is there a secret to getting the swipe while zoomed?
Thanks in advance!
Rob

Where is your swipe gesture recognizer?
Have you tried setting scrollView setCanCancelContentTouches:NO?

Is there a secret to getting the swipe
while zoomed?
Yes, there is. Each UIImageView should be inside its own UIScrollView which in turn are inside of main UIScrollView. No gesture recognizers are needed, just set UIScrollViews options like zoom scales etc and implement UIScrollViewDelegate methods for master UIScrollView.

Related

How to differentiate between pan and scroll in UIScrollView

is there a way to differentiate between pan and scroll in uiscrollview.
I use a scrollGesture to scroll between images with one finger on a UIScrollView. Problem is when I zoom into the image then scrollGesture fires.
I have tried two fingers for scrolling but this interferes with zoom gesture.
I have tried to disable scrollGesture when zoom is >1 but i still need to scroll while zoomed.
Any ideas?
Ok this has been here for quite a long time and got no answer.
The correct answer is YOU CAN NOT.

UIScrollView - scroll or swipe?

In my app I have a UIScrollView and I need to swipe left and right from one picture to the next, but I also need to recognize a scroll.
How do I differentiate between a scroll and a swipe with UIScrollView?
I believe you're actually looking for is an implementation of UIScrollView with Paging, as you do not need to handle the touch events yourself, or determine if they are scrolls or swipes.
The Apple Documentation on Scroll Views and Paging Mode should help you get started
Look into the UIScrollView Delegate Methods. ScrollView can detect different types of actions drag etc or add swipeGesture directly to the scroll view
StackOverflow has questions already on this
iOS: UIScrollView detecting Swipe Gesture
Setting up UIScrollView to swipe between 3 view controllers
How to recognize swipe gesture in UIScrollView

How to intercept vertical swipe gestures

Is there a way to insert my uitableview into the responder chain so I can process some vertical swipes (based on horizontal position) and pass others on to the underlying uiscrollview?
I ended up making my own Gesture Recognizer as explained in this post: Pan gesture interferes with scroll
Use a UISwipeGestureRecognizer on the view, configure the direction to be up and down(vertical)

three finger pinch with custom uigesture on uiscrollview

I have a uiscroll that allows pinching, panning and single/doubletap functionality. I would like to add a three finger pinch in/out to trigger something else in my app. Pinch in and do this, pinch out and do that.
The builtin scroll pinch allows 2 fingers by default. How would I add a third? Subclass? Do I have to remove the gestures already on the scrollview?
Create your own custom subclass gesture to handle the three pinch gesture. Act as it's delegate so you can instruct it to be active at the same time as other gestures. Require it to only start when there are 3 touches. You don't need to remove / replace the standard gestures on the scroll view.

Disable scroll in UIScrollView while multi touching

In my program I use two fingers to pinch (zoom in and out), so sometimes when I want to pinch, app scrolls.
I would like to don't let scrolling in UIScrollView while two or more touches are on screen. How can I achieve that?
Try using UIGestureRecognizer.
In you case you must use a UITapGestureRecognizer, with 2 finger and one tap.
Attach the gesture on the table view.

Resources