In a nutshell, I intend to rotate a full screen size of view (bound size: 320,460) alongside it's y-axis(left edge).
I have achieved rotation via CAAnimation by using the code below:
CATransform3D transform = CATransform3DMakeRotation(M_PI_2, 0, 1, 0);
CGPoint origPoint = self.view.center;
//Set anchor Point
self.view.layer.anchorPoint = CGPointMake(0, 0.5);
//Set center point
[self.view setCenter: origPoint];
transform.m34 = 1.0/8000.0;
transform.m14 = -0.0015;
CABasicAnimation *animRotate = [CABasicAnimation animationWithKeyPath:@"transform.rotation.y"];
[animRotate setFromValue:[NSValue valueWithCATransform3D:transform]];
[animRotate setDuration:4.0];
[self.view.layer addAnimation:animRotate forKey:nil];
So my question is: How can I set the rotation axis as the left edge of this view?
Many thanks.
I took reference about anchor point via this useful blog