Gavin Schulz
Gavin Schulz

Reputation: 4726

Zoomable Graphics

I am trying to draw zoomable graphics onto the screen. I currently have a UIView inside of a ScrollView and I'm wondering what the best way is to go about handling/implementing zooming of the graphics I've drawn on the screen.

Upvotes: 0

Views: 1235

Answers (1)

Brad Larson
Brad Larson

Reputation: 170317

You'll probably want to use something along the lines of what I describe in my answer here.

During the pinch-zooming event, a transform will be applied to your UIView, which will zoom the content but will lead to blurring. Once the zooming event is finished, use the -scrollViewDidEndZooming:withView:atScale: delegate method to determine the new scale factor and resize and re-render your UIView appropriately. If you're doing your drawing using Core Graphics within the -drawRect: method of your UIView, this should be pretty easy to manage.

Upvotes: 2

Related Questions