1.基于控件的形变
默认就是带make的(每次形变都是针对原点)
imageV.transform = CGAffineTransform(translationX: 20, y: 20)
imageV.transform = CGAffineTransform(scaleX: 0.5, y: 0.5)
imageV.transform = CGAffineTransform(rotationAngle: 180)
不带make的(在已经形变的基础上做形变)
imageV.transform = imageV.transform.scaledBy(x: 0.5, y: 0.5)
imageV.transform = imageV.transform.rotated(by: 180)
imageV.transform = imageV.transform.translatedBy(x: 10, y: 10)
#这里与OC的区别比较大...
2.基于layer的形变
作用在layer上的 不带make在效果之后的基础上做
imageV.layer.transform = CATransform3DRotate(imageV.layer.transform, CGFloat(M_PI), 1, 0, 0)
imageV.layer.transform = CATransform3DIdentity 空的transform
imageV.layer.transform = CATransform3DScale(imageV.layer.transform, 0.2, 0.2, 0.2)
作用在layer上的 带make在原点基础上形变
imageV.layer.transform = CATransform3DMakeScale(0.5, 0.5, 0.5)
imageV.layer.transform = CATransform3DMakeRotation(180, 1, 0, 0)
imageV.layer.transform = CATransform3DMakeTranslation(10, 10, 0)