Hopefully someone can help with this issue. I have a class derived from UIScrollView and I'd like to prevent the user from being able to zoom or scroll via manual pinch and swipe gestures. All view navigation will instead be controlled by programmatic means in response to where a user taps (think of an ebook reader where tapping on the left or right sides of the display causes the view to scroll by exactly one page width). Any suggestions on how to implement this?
Ios – How to prevent manual zooming in a UIScrollView
cocoa-touchiosuiscrollview
Related Topic
- Ios – How to check for an active Internet connection on iOS or macOS
- Ios – How to make a UITextField move up when the keyboard is present – on starting to edit
- Ios – Xcode – How to fix ‘NSUnknownKeyException’, reason: … this class is not key value coding-compliant for the key X” error
- Ios – UIScrollView Scrollable Content Size Ambiguity
- Run node.js database migrations on Google Cloud SQL during Google Cloud Build
Best Answer
On your
- (void)viewDidLoad;
you should be able to just disable whatever gesture recognizer you want. In this case:or
I sometimes do this from view controllers that contain UIScrollViews. I just target the scroll view (
self.scrollView.pinchGestureRecognizer
) and temporarily disable gestures when the app. is in a certain state.