Extension

UIView

This extension adds a convenient resizing method to UIView

Declaration

extension UIView

Overview

This extension adds a function to UIView that makes it a bit easier to set the view’s transform.

Topics

Transforming

This function takes in 3 parameters (scaleX, scaleY, rotation) then creates a new CGAffineTransform and applies it properly to the view.

setTransform(…)

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
}
background Made with Flow.
underscore Made with Flow.
line2 Made with Flow.
line1 Made with Flow.
circle Made with Flow.
hit Made with Flow.

result(s) found for “”.