Could somebody advice which formula used to content offset calculation after zoom in UIScrollView? Let's consider following example:
I have a UIScrollView with content view in size (1000, 1000), then if I programmatically setZoomScale
to 2.0 and in scrollViewDidEndZooming:withView:atScale
method I will have the following:
contentSize before zoom = {1000, 1000}
contentOffset before zoom = {0, 0}
scale = 2.000000
contentSize after zoom = {2000, 2000}
contentOffset after zoom = {160, 230}
I need to know how the new value of contentOffset {160, 230} calculated. Is there any dependency of formula that used to calculate the content offset in this case?
Thanks