I would like to decrease the zooming speed behavior of a UIScrollView
.
I've tried the solutions given in this two answers: Answer 1, Answer 2, but I'm not getting the expected results.
This is my implementation of answer 2:
- (void)scrollViewDidZoom:(UIScrollView *)scrollView {
if(scrollView.multipleTouchEnabled){
CGFloat fSpeedZoom = 2;
CGFloat fMaxZoomScale = scrollView.maximumZoomScale;
CGFloat fMinZoomScale = scrollView.minimunZoomScale;
scrollView.maximumZoomScale = scrollView.zoomScale + fSpeedZoom;
scrollView.minimumZoomScale = scrollView.zoomScale - fSpeedZoom;
if(scrollView.maximumZoomScale > fMaxZoomScale){
self.scrollView.maximumZoomScale = fMaxZoomScale;
}
if(scrollView.minimumZoomScale < fMinZoomScale){
self.scrollView.minimumZoomScale = fMinZoomScale;
}
}
}
If I keep the fSppedZoom
values between 2 and 5 I get kind of an exponential behavior in which the further I try to zoom, the slower it zooms. I would like to get a linear behavior in which with a single parameter I could control the zooming speed.