steipete/PSPDFTextView — pull request #3 by Ciechan (2014-01-16 22:52:45+00:00)
Title: Fixed bug that caused some UIScrollView delegate method to not fire

Presumably for performance reasons `UIScrollView` has some flags that mark whether its delegate implements some of the UIScrollViewDelegate methods:

...
unsigned int delegateScrollViewDidScroll : 1;
unsigned int delegateScrollViewDidZoom : 1;
unsigned int delegateContentSizeForZoomScale : 1;

The `respondsToSelector:` check occurs when the delegate is set, and only **if the delegate is different** than the already stored. Since the code keeps setting the same delegate, the UIScrollView won't recheck the realDelegate for implementations. I fixed the issue by nilling out the delegate, as we as reordering the realDelegate setter, to make sure the UIScrollView queries the correct object.