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

# rotationEffect(_:anchor:)

Rotates content in two dimensions around the specified point.

## Declaration

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

```

## Parameters

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

## Return Value

Return Value A rotation effect.

## Discussion

Discussion This effect rotates the content around the axis that points out of the xy-plane. It has no effect on the content’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: Text("Rotation by passing an angle in degrees")     .visualEffect { content, geometryProxy in         content             .rotationEffect(.degrees(22))     }     .border(Color.gray)

## See Also

### Rotating

- [rotation3DEffect(_:axis:anchor:anchorZ:perspective:)](swiftui/visualeffect/rotation3deffect(_:axis:anchor:anchorz:perspective:).md)
- [perspectiveRotationEffect(_:axis:anchor:perspective:)](swiftui/visualeffect/perspectiverotationeffect(_:axis:anchor:perspective:).md)
- [rotation3DEffect(_:anchor:)](swiftui/visualeffect/rotation3deffect(_:anchor:).md)
- [rotation3DEffect(_:axis:anchor:)](swiftui/visualeffect/rotation3deffect(_:axis:anchor:).md)
