Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Implementing pinch/double tap to zoom for a UIImage [duplicate]

I am trying to workout how to implement a UIImage that has pinch/double tap to zoom. Is this possible with a standard UIImageView?

Looking at other questions at documentation it has to be completed with a UIScrollView?

Source: https://developer.apple.com/library/ios/documentation/windowsviews/conceptual/UIScrollView_pg/ZoomingByTouch/ZoomingByTouch.html

The issue I see is that the above link suggests using initWithImage on the scrollView, but that is not available?

I am looking to implement an Image that is full screen (no larger), if the image is larger it should scale Aspect to Fit into the full screen. The user can then double tap or Pinch to zoom into the image. What is the correct approach for this?

like image 472
StuartM Avatar asked Dec 27 '13 19:12

StuartM


1 Answers

Never try to zoom an image itself - it consumes just too much time. Instead, as you've mentioned, zoom the view. It can be made with UIScrollView using almost default parameters.

Here is how: How to zoom in/out an UIImage object when user pinches screen?

like image 102
dreamzor Avatar answered Nov 17 '22 13:11

dreamzor