I am trying to recreate the behavior of a photo app where you can pan, pinch and rotate at the same time. I have the basics of work, but I'm stuck.
For panning, I compensate for the center point of the presentation with the number of translations. It works well.
For pinch and rotation, I apply the affine transform to the view. This also works well.
The problem is when I pan (i.e. move the subview) and then pinch or rotate - the affine transform seems to be applied using the old center point of the view. Although I should use the current center point as the source of the transformation - as I update the center point when I pan, although this should work. Instead of turning around the center spy point, I get a rotational movement relative to the starting center point.
How to fix it? Obviously, you can combine these three gestures intuitively, as the photo application does this successfully.
I tried using the affine translation to pan, but the effect was the same.
source
share