I have been trying to implement pinch zoom/in-out for PhotoView (a UIImageView instance) using CGAffinTransformScale (planing to use rotation so can not count on frames for the
An answer from the left-field perhaps, but an alternative might be to place the UIImageView inside a UIScrollView, define a viewForZoomingInScrollView:
method on your scroll view delegate, and set the maximumZoomScale
/minimumZoomScale
properties and you'll have your pinch zooming without needing to implement the calculations to set the transform yourself? I've just done this on a recent project and it worked well.
Generally speaking, whenever you implement a continuous UI behavior, you need to measure it against something that does not change.
So if your touches cause the View transformation to change, you should measure the touches against something that does not change - your parent view for instance. So, instead of calling :
[touch locationInView:self]
you should use
[touch locationInView:[self superview]]
I am not sure if this will fix your problem, but it will eliminate one possible cause of your troubles.