<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSView/rotate(byDegrees:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSView(im)rotateByAngle:"
  },
  "title" : "rotate(byDegrees:)"
}
-->

# rotate(byDegrees:)

Rotates the view’s bounds rectangle by a specified degree value around the origin of the coordinate system, (0.0, 0.0).

```
func rotate(byDegrees angle: CGFloat)
```

## Parameters

`angle`

A `float` value specifying the angle of rotation, in degrees.

## Discussion

See the [`boundsRotation`](/documentation/AppKit/NSView/boundsRotation) method description for more information. This method neither redisplays the view nor marks it as needing display. You must do this yourself by calling the [`display()`](/documentation/AppKit/NSView/display()) method or setting the [`needsDisplay`](/documentation/AppKit/NSView/needsDisplay) property.

This method posts an [`boundsDidChangeNotification`](/documentation/AppKit/NSView/boundsDidChangeNotification) to the default notification center if the view is configured to do so.

## See Also

[`frameRotation`](/documentation/AppKit/NSView/frameRotation)

The angle of rotation, measured in degrees, applied to the view’s frame rectangle relative to its superview’s coordinate system.

[`postsBoundsChangedNotifications`](/documentation/AppKit/NSView/postsBoundsChangedNotifications)

A Boolean value indicating whether the view posts notifications when its bounds rectangle changes.



---

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)