Logic Explain

To support rotation,

  1. You need a rotation gesture to get the current rotation value that's provided by user pinching gesture
  2. Once you have the rotation value, you need a way to combine this "new" rotation together with the "old" rotation that already exists

Steps to follow

  1. Create a RotationGesture variable
  2. Your view rotation is equal to your origin rotation + the rotation created by your gesture
  3. After changing, you need to update the origin rotation to be the new rotation
  4. Apply the rotation to the view
  5. use .gesture(rotationGesture) to make effect of your gesture

Untitled