The rotation gesture is also a two-finger gesture in which one finger is kept stationary and the second finger is rotated around the other finger in clockwise or anticlockwise motions, resulting in the image rotating in the direction of the motion of the finger.
We will use the same background image to rotate it this time around. Do create a new global float variable called
lastRotAngle to keep track of the previous rotated angle as it will be required.
As usual, we will create the rotation gesture, initialize it, and provide the function to update the image. So, in the
init function, we will add the following:
// ** rotation ** // UIRotationGestureRecognizer* rotationRecognizer = [[UIRotationGestureRecognizeralloc] ...