Can I set the start of rotation when rotating the view using CGAffineTransformMakeRotation ()?

I have a UIImageView that I want to rotate a bit, but I need to define a special origin for the rotation. How could I do this? More precisely, I have an image of a goblet and I want it to wiggle on the table. It has a square. So when wiggeling to the left, my start of rotation should be the left corner of this square. And when wiggeling to the right, the start of the rotation should be the right angle of that square.

How could I do this? I already have this:

myView.transform = CGAffineTransformMakeRotation (.25);

-2


a source to share


1 answer


There was a similar question on how to achieve this here .



The best answer was to change the property of the anchorPoint

underlying layer UIView

.

+1


a source







All Articles