This is my first post, so my apologies if I word any of this incorrectly. I will be happy to clarify if need be.
I have a pageViewController and each viewController it presents contains a scrollView which displays an imageView from an in-app photo gallery (very similar to enlarging a photo in the Photos app and then swiping through the collection of images). I've implemented zooming in and out through pinch gestures and generally everything is working, however, when I swipe from one image to the next, then back to the original, and then try swiping forward or backwards, the view gets "stuck". To illustrate this a bit better, say you select image 2 in the gallery. If you swipe to image 3, then swipe back to image 2, swiping towards either image 1 or image 3 shows a sliver of the image you're trying to get to and then snaps back to image 2.
A quick pinch to zoom the image out a bit and have it lock back into the width of the screen allows you to freely zoom forward or backwards again. I've tried adding some code in viewDidAppear to zoom the image out quickly and then let it snap back to the bounds of the screen to simulate this gesture, but as expected you can see the adjustment happening each time a new image is put on the screen and I'd like the swiping to be smooth.
Any ideas as to a way to fix this would be greatly appreciated. I've read into Apple's documentation regarding both scrollViews and pageViews as well as their associated delegates and datasources but haven't been able to find a source of this problem, though I may have simply overlooked something.
As stated above, please let me know if I can offer any clarification to the issue at hand. Thanks in advance.