让视图旋转其实很简单:
将下列代码放到- (void)viewDidLoad 中:
//1.旋转360度:
//1.1旋转180度
self.view.transform = CGAffineTransformRotate(self.view.transform, M_PI);
//1.2旋转时间间隔设置
[UIView beginAnimations:nil context:UIGraphicsGetCurrentContext()];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; //InOut 表示进入和出去时都启动动画
[UIView setAnimationDuration:0.5f];//动画时间
//1.3旋转180度
self.view.transform = CGAffineTransformRotate(self.view.transform, -M_PI);