views:

211

answers:

0

I'm rotating a view that's placed in Interface Builder using CGAffineTransformMakeRotation, but even though I have the anchor point set to the top left in Interface Builder the rotation still happens around the center of the view. As a crappy work around I am setting the anchor point upon startup and then repositioning the view, i.e.:

[view.layer setAnchorPoint:CGPointMake(0.0, 0.0)];
[view.layer setPosition:CGPointMake(view.layer.position.x - (0.5 * view.layer.frame.size.width), 
              view.layer.position.y - (0.5 * view.layer.frame.size.height))];

But that's pretty nasty and feels like unnecessary work. So what's the relationship between the anchor point set in Interface Builder, and the one that I'll see in code via view.layer.anchorPoint?

Thanks!