Search code examples
iphoneiosrotationscale

iPhone What should I do to keep the angle as I set and change the size?


I’m adjusting a view’s scale and rotation using two UISliders.

When I change the rotation of view and then change it's scale, the rotation returns to 0 and the scale is also initialized.

What should I do to keep the rotation constant as I set and change the scale?


Solution

  • You should concat the transformations like this: CGAffineTransformConcat(CGAffineTransformMakeScale(scaleX, scaleY), CGAffineTransformMakeRotation(angle));