Iphone – zoomScale for OS 2.0

iphone

Is there any alternative or work around so that I can use zoomScale in Iphone OS 2.0. It seems the property is only available in Iphone OS 3.0 or later?

I have two subviews in my UIScrollView and if the first subview reach a specified scale then it will change to the other subview and save the current scale to zoomScale so that the new subview will apply to the previous scale. Like for example in, scrollViewDidEndZooming,

scrollView.zoomScale = scale;

When I run my app in Iphone OS 2.0, it gives me error saying invalid zoomScale invalid selector.

How can I work around this?

Thanks.

Best Answer

The only way to achieve the effect of non-initial zoom=1 on early iPhone OS platforms is to manually scale your drawing and initial view positions as if zoom were not equal to one. Painful. But conceptually all your doing (if you solve this problem) is adding one extra scale factor related to the difference between zoom=1 and the initial zoom factor desired.

A right old pain involving lots of code edits to add the extra scale factors but at least this gets the result! On iPhone OS 3 (if your code runs on multiple platforms) the factor will always be unity 1.