In Swift 2, we could do this to get a rotation and a stretch:
let rotate = CGAffineTransformMakeRotation(1)
let stretchAndRotate = CGAffineTransformScale(rotate, 0.8, 0.8)
label.transform = stretchAndRotate
In Swift 3, CGAffineTransformScale has become CGAffineTransform and no longer accepts a rotation.
What is the simplest way to apply a stretch and rotation to an object now?
Thanks,
Rob
In Swift 3 many global C functions are mapped to member functions of the corresponding type, compare "Import as member" on swift-evolution.
In your case it would be
let rotate = CGAffineTransform(rotationAngle: 1.0)
let stretchAndRotate = rotate.scaleBy(x: 0.8, y: 0.8)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With