Contents

transformEffect(_:)

Applies an affine transformation to this view’s rendered output.

Declaration

nonisolated func transformEffect(_ transform: CGAffineTransform) -> some View

Parameters

Discussion

Use transformEffect(_:) to rotate, scale, translate, or skew the output of the view according to the provided CGAffineTransform.

In the example below, the text is rotated at -30˚ on the y axis.

let transform = CGAffineTransform(rotationAngle: -30 * (.pi / 180))

Text("Projection effect using transforms")
    .transformEffect(transform)
    .border(Color.gray)

[Image]

See Also

Scaling, rotating, or transforming a view