Extension
This extension adds a convenient resizing method to UIView
extension UIView
This extension adds a function to UIView
that makes it a bit easier to set the view’s transform.
This function takes in 3 parameters (scaleX
, scaleY
, rotation
) then creates a new CGAffineTransform
and applies it properly to the view.
func setTransform(scaleX: CGFloat, scaleY: CGFloat, rotationAngle: CGFloat) {
var transform = CGAffineTransform.identity
transform = transform.concatenating(CGAffineTransform(scaleX: scaleX, y: 1.0))
transform = transform.concatenating(CGAffineTransform(scaleX: 1.0, y: scaleY))
transform = transform.concatenating(CGAffineTransform(rotationAngle: rotationAngle))
self.transform = transform
}
result(s) found for “”.