Is there an "accepted" way of performing (pinch) zoom on a view that is not based on UIScrollView?
+1
A:
There's a code sample by Erica Sadun that does the math for treating touch events as scale/rotate/translate transforms that you can probably borrow from. Basically, it sounds like you want to apply a scaling affine transform. This code doesn't include the niceties of "bouncing" the view when you reach the edges of the content, so you'll have to do that yourself.
Full disclosure: I haven't done this in almost a year. It's likely that there are frameworks now that include much more straightforward support for this feature.
warrenm
2010-03-07 23:55:20
Your link requires basic auth. :-(
Jonny
2010-10-27 03:48:44
The code I was referring to has since been relocated to github: http://github.com/erica/iphone-3.0-cookbook-/blob/master/C08-Gestures/14-Resize%20And%20Rotate/main.m Hope that helps.
warrenm
2010-10-27 17:28:42
A:
If you are working in iPhone OS 3.2 (for the iPad) or iOS 4 for the iPhone 4, you can use the UIPinchGestureRecognizer class to detect pinch gestures.
rekle
2010-07-12 21:55:13