UIRotationGestureRecognizerEvent: rotation property
The rotation property is the angle turned since the gesture began.
Value
A number, in radians. Clockwise is positive.
- Read-only. Assigning to it throws
TypeError. - When the event is created with
newwithout it, it is0.
Examples
js
const dial = new UIView();
const turn = new UIRotationGestureRecognizer();
turn.addEventListener('changed', (e) => {
dial.transform = CGAffineTransform.rotation(e.rotation);
});
dial.addGestureRecognizer(turn);Effect: turning two fingers on dial rotates it along.
Corresponding iOS API
recognizer.rotation.