How To Rotate View In SwiftUI

SwiftUI has two modifiers to rotate the view, one it rotationEffect and the second is rotation3DEffect.

The rotationEffect changes Z-axis of the view. It accepts Angle in the constructor which can be used with degrees or with radians.


Or with radians.


If you need to changes other axes than Z use the 3D effect.

    .rotation3DEffect(.degrees(180.0), axis: (x: 0, y: 0, z: 1))

All three examples rotate views in the same, the text is upside down.