I\'m going to describe the effect I want to achieve, and then I\'ll give detail on how I\'m currently trying to implement this and what\'s wrong with its behavio
Some very minor tweaks to the above code have resolved What Doesn't Work 1 & What Doesn't Work 2 in the question.
I have added the following lines in to the viewDidLoad
method of my UICollectionViewController
:
[collectionView setMinimumZoomScale: 0.25];
[collectionView setMaximumZoomScale: 4];
I've also updated the example project so that instead of text labels, the view is made of little circles. As you zoom in and out, these are resized. Here's what it looks like now (zoomed out and zoomed in):
During a zoom the views for the circles are not redrawn, but just interpolated from their pre-zoom size. The redraw is postponed until the zoom finishes. Here's a capture of how that looks after a zoom in of several times:
It would be great to have the redrawing during zoom happen in a background thread so that the artefacts are less noticeable, but that's well out of the scope of this question and I've not worked on it yet either.
You can find the entire project, with fixes, on Bit Bucket so you can grab the files there.
I was hoping that with this question answered, I'd have lots of new certainty about UIScrollView
zooming. I don't.
From what I've read about UIScrollView, this "fix" should not have made any difference and it should have already worked in the first place anyway.
A UIScrollView
isn't supposed to enable scrolling until you give it a delegate that implements viewForZoomingInScrollView:
, which I've not done.