SwipeView icon indicating copy to clipboard operation
SwipeView copied to clipboard

Infinite loop when rubberbanding nested zoomed UIScrollViews

Open n00neimp0rtant opened this issue 10 years ago • 3 comments

Here's where it keeps getting looped: image

So here's my setup: I need a horizontal swipe view with images as each item in the swipe view, but each image should be zoomable on it's own. I take a UIImageView, place it into a UIScrollView, make the scroll view zoomable by setting the scale properties and delegate, then place the scroll view as an item in the swipe view. I can swipe through them and zoom as expected. If I zoom in then use a single finger to swipe across the image, my own scroll view grabs the touch event and allows me to pan around the image (this is expected/desired behavior!), but if I reach the edge of the image where it should start rubberbanding, the app instantly locks up and Xcode informs me of that infinite loop.

It should be noted that my scroll view (the zoomable, pannable one that is acting as an item for the swipe view) is a UIScrollView subclass that has its delegate set to itself. Not sure if this has anything to do with the issue, but I figured it was worth mentioning.

n00neimp0rtant avatar May 09 '14 20:05 n00neimp0rtant

I have the same setup, and same crashing.

asm09fsu avatar Aug 13 '14 20:08 asm09fsu

I found out what the issue is with this. You can reproduce this by zooming into the image, rotating the device, and then panning the image. What you need to do is on autorotateDidFinish, zoom the image out.

asm09fsu avatar Dec 12 '14 17:12 asm09fsu

Placing a UIScrollView into SwipeView directly would cause this problem. To solve the issue, use a normal UIView and add the scroll view to that view. This way SwipView's scroll event won't mess up with your own scroll view's.

ashchan avatar Feb 24 '16 01:02 ashchan