Prework

Create a container to store the state of the three gestures

size to store the result of the scale gesture (For example: if the user scales the size to 2X, the size will become (500, 360), and the state will be stored here)

Similarly:

offset to store the result of the drag gesture

rotation to store the result of the rotate gesture

Untitled

  1. Drag
  2. Rotate

Because you scale or rotate gesture both use two fingers pinching, the system cannot tell which gestures we are performing, so we combine two gestures using a SimultaneousGesture to let the system know if it detects two fingers moving, it processes both

Untitled

  1. Scale