<!--
{
  "availability" : [
    "iOS: 2.0.0 - 9.0.0",
    "iPadOS: 2.0.0 - 9.0.0",
    "macCatalyst: 13.1.0 - 13.1.0"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIApplication/setStatusBarOrientation(_:animated:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIApplication(im)setStatusBarOrientation:animated:"
  },
  "title" : "setStatusBarOrientation(_:animated:)"
}
-->

# setStatusBarOrientation(_:animated:)

Sets the app’s status bar to the specified orientation, optionally animating the transition.

```
func setStatusBarOrientation(_ interfaceOrientation: UIInterfaceOrientation, animated: Bool)
```

## Parameters

`interfaceOrientation`

A specific orientation of the status bar. See [`UIInterfaceOrientation`](/documentation/UIKit/UIInterfaceOrientation) for details. The default value is [`UIInterfaceOrientation.portrait`](/documentation/UIKit/UIInterfaceOrientation/portrait).

`animated`

<doc://com.apple.documentation/documentation/Swift/true> if the transition to the new orientation should be animated; <doc://com.apple.documentation/documentation/Swift/false> if it should be immediate, without animation.

## Discussion

Calling this method changes the value of the  [`statusBarOrientation`](/documentation/UIKit/UIApplication/statusBarOrientation) property and rotates the status bar, animating the transition if animated is <doc://com.apple.documentation/documentation/Swift/true> . If your app has rotatable window content, however, you should not arbitrarily set status-bar orientation using this method. The status-bar orientation set by this method does not change if the device changes orientation.

## See Also

[`statusBarOrientationAnimationDuration`](/documentation/UIKit/UIApplication/statusBarOrientationAnimationDuration)

The animation duration in seconds for the status bar during a 90 degree orientation change.

[`statusBarOrientation`](/documentation/UIKit/UIApplication/statusBarOrientation)

The current orientation of the app’s status bar.



---

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)