Instance Method

inverted()

Returns an affine transformation matrix constructed by inverting an existing affine transform.

Declaration

func inverted() -> CGAffineTransform

Parameters

t

An existing affine transform.

Return Value

A new affine transformation matrix. If the affine transform passed in parameter t cannot be inverted, the affine transform is returned unchanged.

Discussion

Inversion is generally used to provide reverse transformation of points within transformed objects. Given the coordinates (x,y), which have been transformed by a given matrix to new coordinates (x’,y’), transforming the coordinates (x’,y’) by the inverse matrix produces the original coordinates (x,y).

See Also

Modifying Affine Transformations

func translatedBy(x: CGFloat, y: CGFloat) -> CGAffineTransform

Returns an affine transformation matrix constructed by translating an existing affine transform.

func scaledBy(x: CGFloat, y: CGFloat) -> CGAffineTransform

Returns an affine transformation matrix constructed by scaling an existing affine transform.

func rotated(by: CGFloat) -> CGAffineTransform

Returns an affine transformation matrix constructed by rotating an existing affine transform.

func concatenating(CGAffineTransform) -> CGAffineTransform

Returns an affine transformation matrix constructed by combining two existing affine transforms.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software