How do you forcibly cancel a zooming open pinch gesture on a UIScrollView, say when the user has zoomed “sufficiently” far to trigger a new action?
How do you forcibly cancel a zooming open pinch gesture on a UIScrollView ,
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
To prevent user-controller zooming and panning but still allow programmatic zooming and panning of a scrollview, the best approach is to override the
UIScrollView's–addGestureRecognizer: method in a subclass.Each gesture recognizer is simply disabled, for finer control (for ex. allowing the pan control but only allow zooming via a double tap for instance) you’d simply check the incoming gesture recognizer via
-isKindOfClass:and disabling as appropriate.Hope this helps.