Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to zoom a UIScrollView programmatically the exact same way as one I'm manually zooming

I have 2 UIScrollViews side by side, and a feature I'm working on is the ability to pinch and zoom on 1 UIScrollView, and have the other one next to it respond in the EXACT same way as the one I'm tapping. Of particular interest is zooming in on the same area that the other UIScrollView is zooming in on. It's one thing to just set the zoomScale, but it's another to mimic the zoom behavior exactly.

How can I do this?

like image 797
Stephen J. Avatar asked Dec 28 '22 17:12

Stephen J.


1 Answers

Use following method it will help you,

- (void)zoomToRect:(CGRect)rect animated:(BOOL)animated

In above method you have pass only rect of your view it will zooming inside that rect.

for additional information please read documentation.

like image 88
Tirth Avatar answered Dec 30 '22 07:12

Tirth