Implement pinch / double tap to zoom for UIImage

I am trying to train how to implement UIImagethat has a pinch / double tap to zoom. Is this possible with the standard UIImageView?

When considering other issues in the documentation, should it be filled in with UIScrollView?

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

The problem I see is that the link above assumes use initWithImagein scrollView, but is this not available?

I am looking to implement a full-screen image (no larger), if the image is larger, it should scale Aspect to Fit in full screen. The user can then double-tap or tap Pinch to enlarge the image. What is the right approach for this?

+4
source share
1 answer

Never try to scale the image yourself - it consumes too much time. Instead, as you mentioned, increase the view. This can be done using UIScrollView, using almost standard parameters.

Here's how: How do I zoom in / out on a UIImage object when the user grabs the screen?

+8

All Articles