Mike Valstar

Web Development, Programming, Random Thoughts

Twitter Status...

A Zoomable UIImageView

Posted on

The preferred method for creating an image you can zoom and pan on is to nest a UIImageView inside a UIScrollView. see example here

But in a recent project I found myself needing to highly customize how this performed. My first step was recreating the functionality of UIScrollView wining a UIImageView itself. What I mostly needed to change as far as behaviour was to change the panning speed as well as turning off the pan gesture at specific times so that the image view could exist inside another class that also responded to the pan gesture.

Heres the code:

UIImageViewResizable

bp_114
comments powered by Disqus
Mike Valstar © 2012