1.平移,缩放,旋转
//平移
self.tempView.transform = CGAffineTransformMakeTranslation(-100, 100);
//缩放
self.tempView.transform = CGAffineTransformMakeScale(0.5, 0.5);
//旋转
self.tempView.transform = CGAffineTransformMakeRotation(-M_PI_4);
2.除此之外还可以叠加动画效果,三种或者两种合起来
//平移+缩放+旋转
CGAffineTransform translation = CGAffineTransformMakeTranslation(-100, 100);
CGAffineTransform scaleTranslation = CGAffineTransformScale(translation, 0.5, 0.5);
CGAffineTransform rotateScaleTranslation = CGAffineTransformRotate(scaleTranslation, M_PI_2);
self.tempView.transform = rotateScaleTranslation;
3.清空以前的效果
// 清空transform,以前的平移、缩放、旋转都会消失
[UIView animateWithDuration:2.0 animations:^{
self.tempView.transform = CGAffineTransformIdentity;
}];