<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/View/rotationEffect(_:anchor:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4ViewPAAE14rotationEffect_6anchorQrAA5AngleV_AA9UnitPointVtF"
  },
  "title" : "rotationEffect(_:anchor:)"
}
-->

# rotationEffect(_:anchor:)

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

```
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 [`center`](/documentation/SwiftUI/UnitPoint/center).

## Return Value

A view with rotated content.

## 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)
```

![A screenshot of text and a wide grey box. The text says Rotation by passing an angle in degrees. The baseline of the text is rotated clockwise by 22 degrees relative to the box. The center of the box and the center of the text are aligned.](images/com.apple.SwiftUI/SwiftUI-View-rotationEffect@2x.png)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)