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

# setStatusBarHidden(_:with:)

Hides or shows the status bar, optionally animating the transition.

```
func setStatusBarHidden(_ hidden: Bool, with animation: UIStatusBarAnimation)
```

## Parameters

`hidden`

<doc://com.apple.documentation/documentation/Swift/true> to hide the status bar, <doc://com.apple.documentation/documentation/Swift/false> to show the status bar.

`animation`

A constant that indicates whether there should be an animation and, if one is requested, whether it should fade the status bar in or out or whether it should slide the status bar in or out.

## Discussion

See the descriptions of the constants of the [`UIStatusBarAnimation`](/documentation/UIKit/UIStatusBarAnimation) type for more information.

---

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)