Contents

setStatusBarStyle(_:animated:)

Sets the style of the status bar, optionally animating the transition to the new style.

Declaration

func setStatusBarStyle(_ statusBarStyle: UIStatusBarStyle, animated: Bool)

Parameters

  • statusBarStyle:

    A constant that specifies a style for the status bar. See the descriptions of the constants in Uistatusbarstyle for details.

  • animated:

    True if the transition to the new style should be animated; otherwise False .

Discussion

The animation slides the status bar out toward the top of the interface.

In iOS 7 and later, status bar behavior is determined by view controllers, and so calling this method has no effect by default. When view controller-based status bar appearance is disabled, this method behaves normally. To opt out of the view controller-based status bar appearance behavior, you must add the UIViewControllerBasedStatusBarAppearance key with a value of false to your app’s Info.plist file, but doing so is not recommended.

See Also

Related Documentation

Deprecated methods