UIRotationGestureRecognizer changes with CGAffineTransformMakeScale

Posted by user523234 on Stack Overflow See other posts from Stack Overflow or by user523234
Published on 2012-12-02T16:05:37Z Indexed on 2012/12/02 17:04 UTC
Read the original article Hit count: 154

A view is flipped using this:

self.transform = CGAffineTransformMakeScale(-1, 1);  // self is an UIView

To rotate this view:

-(void)handleRotate:(UIRotationGestureRecognizer *)recognizer
{
    recognizer.view.transform = CGAffineTransformRotate(recognizer.view.transform, recognizer.rotation);
    recognizer.rotation = 0;
}

The issue is that after the view is flipped so is the rotation's direction. Any solution how to fix this?

Edit: My current solution is using a boolean and negate the recognizer.rotation value in handleRotate method. But I am still looking for the technical solution.

© Stack Overflow or respective owner

Related posts about ios

Related posts about uigesturerecognizer