Temporarily disable paging in UIScrollView

Hi,


I have a photo gallery application where the zoomable photo view is a UIImageView in a UIScrollView nested in a UIScrollView for paging between photos in the gallery. When I'm in zoomed mode I want to disable the swipe gesture that brings me to the next page. The paging UIScrollView does not publically export its gesture recognizers. What would be the best way to achieve temporarily disabling the paging in this case without traversing the private hierarchy (such as, looking for the _UIQueuingScrollView which has a UIScrollViewPagingSwipeGestureRecognizer, which is probably the interesting one...)?

Answered by DrMickeyLauer in 205013022

Ok, right after messing with the private hierarchy it occured to me that I could do it in an official way by just setting scrollEnabled and pagingEnabled in the respective UIPagingViewController's UIScrollView to FALSE. No need to mess around with the gesture recognizers.

Accepted Answer

Ok, right after messing with the private hierarchy it occured to me that I could do it in an official way by just setting scrollEnabled and pagingEnabled in the respective UIPagingViewController's UIScrollView to FALSE. No need to mess around with the gesture recognizers.

Temporarily disable paging in UIScrollView
 
 
Q