---
title: "rotationEffect(_:anchor:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/view/rotationeffect(_:anchor:)"
---

# rotationEffect(_:anchor:)

Rotates a view’s rendered output in two dimensions around the specified point.

## Declaration

```swift
nonisolated func rotationEffect(_ angle: Angle, anchor: UnitPoint = .center) -> some View

```

## Parameters

- `angle`: The angle by which to rotate the view.
- `anchor`: A unit point within the view about which to perform the rotation. The default value is doc://com.apple.SwiftUI/documentation/SwiftUI/UnitPoint/center.

## Return Value

Return Value A view with rotated content.

## Discussion

Discussion This modifier rotates the view’s content around the axis that points out of the xy-plane. It has no effect on the view’s frame. The following code rotates text by 22˚ and then draws a border around the modified view to show that the frame remains unchanged by the rotation modifier: Text("Rotation by passing an angle in degrees")     .rotationEffect(.degrees(22))     .border(Color.gray)

## See Also

### Scaling, rotating, or transforming a view

- [scaledToFill()](swiftui/view/scaledtofill().md)
- [scaledToFit()](swiftui/view/scaledtofit().md)
- [scaleEffect(_:anchor:)](swiftui/view/scaleeffect(_:anchor:).md)
- [scaleEffect(_:anchor:)](swiftui/view/scaleeffect(_:anchor:).md)
- [scaleEffect(x:y:anchor:)](swiftui/view/scaleeffect(x:y:anchor:).md)
- [scaleEffect(x:y:z:anchor:)](swiftui/view/scaleeffect(x:y:z:anchor:).md)
- [aspectRatio(_:contentMode:)](swiftui/view/aspectratio(_:contentmode:).md)
- [rotation3DEffect(_:axis:anchor:anchorZ:perspective:)](swiftui/view/rotation3deffect(_:axis:anchor:anchorz:perspective:).md)
- [perspectiveRotationEffect(_:axis:anchor:anchorZ:perspective:)](swiftui/view/perspectiverotationeffect(_:axis:anchor:anchorz:perspective:).md)
- [rotation3DEffect(_:anchor:)](swiftui/view/rotation3deffect(_:anchor:).md)
- [rotation3DEffect(_:axis:anchor:)](swiftui/view/rotation3deffect(_:axis:anchor:).md)
- [transformEffect(_:)](swiftui/view/transformeffect(_:).md)
- [transform3DEffect(_:)](swiftui/view/transform3deffect(_:).md)
- [projectionEffect(_:)](swiftui/view/projectioneffect(_:).md)
- [ProjectionTransform](swiftui/projectiontransform.md)
