Instance Method

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

Deprecated Symbols

func setMinimumBackgroundFetchInterval(TimeInterval)

Specifies the minimum amount of time that must elapse between background fetch operations.

Deprecated
var statusBarOrientationAnimationDuration: TimeInterval

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

Deprecated
class let didChangeStatusBarFrameNotification: NSNotification.Name

Posted when the frame of the status bar changes.

Deprecated
class let didChangeStatusBarOrientationNotification: NSNotification.Name

Posted when the orientation of the app’s user interface changes.

Deprecated
class let willChangeStatusBarOrientationNotification: NSNotification.Name

Posted when the app is about to change the orientation of its interface.

Deprecated
class let willChangeStatusBarFrameNotification: NSNotification.Name

Posted when the app is about to change the frame of the status bar.

Deprecated
class let statusBarOrientationUserInfoKey: String

A key whose value is an NSNumber object that encapsulates a UIInterfaceOrientation value indicating the current orientation (see UIInterfaceOrientation). This key is used with didChangeStatusBarOrientationNotification and willChangeStatusBarOrientationNotification notifications.

Deprecated
class let statusBarFrameUserInfoKey: String

A key whose value is an NSValue object that encapsulates a CGRect structure expressing the location and size of the new status bar frame. This key is used with didChangeStatusBarFrameNotification and willChangeStatusBarFrameNotification notifications.

Deprecated
var statusBarFrame: CGRect

The frame rectangle defining the area of the status bar.

Deprecated
var isNetworkActivityIndicatorVisible: Bool

A Boolean value that turns an indicator of network activity on or off.

Deprecated
let UIMinimumKeepAliveTimeout: TimeInterval

The minimum amount of time (measured in seconds) an app may run a critical background task in the background.

Deprecated
func registerUserNotificationSettings(UIUserNotificationSettings)

Registers your preferred options for notifying the user.

Deprecated
var currentUserNotificationSettings: UIUserNotificationSettings?

Returns the user notification settings for the app.

Deprecated
struct UIRemoteNotificationType

Constants indicating the types of notifications the app may display to the user.

Deprecated
func openURL(URL) -> Bool

Attempts to open the resource at the specified URL.

Deprecated
func scheduleLocalNotification(UILocalNotification)

Schedules a local notification for delivery at its encapsulated date and time.

Deprecated
func presentLocalNotificationNow(UILocalNotification)

Presents a local notification immediately.

Deprecated
func cancelLocalNotification(UILocalNotification)

Cancels the delivery of the specified scheduled local notification.

Deprecated
func cancelAllLocalNotifications()

Cancels the delivery of all scheduled local notifications.

Deprecated
var scheduledLocalNotifications: [UILocalNotification]?

All currently scheduled local notifications.

Deprecated
func setNewsstandIconImage(UIImage?)

Sets the icon of a Newsstand app to an image depicting the current issue of a publication.

Deprecated
func setKeepAliveTimeout(TimeInterval, handler: (() -> Void)?) -> Bool

Configures a periodic handler for VoIP apps in older versions of iOS.

Deprecated
func clearKeepAliveTimeout()

Removes a previously installed periodic handler block.

Deprecated
func setStatusBarHidden(Bool, with: UIStatusBarAnimation)

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

Deprecated
var isStatusBarHidden: Bool

A Boolean value that determines whether the status bar is hidden.

Deprecated
var statusBarStyle: UIStatusBarStyle

The current style of the status bar.

Deprecated
func setStatusBarOrientation(UIInterfaceOrientation, animated: Bool)

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

Deprecated
var statusBarOrientation: UIInterfaceOrientation

The current orientation of the app's status bar.

Deprecated
func registerForRemoteNotifications(matching: UIRemoteNotificationType)

Register to receive remote notifications of the specified types via Apple Push Notification service.

Deprecated
func enabledRemoteNotificationTypes() -> UIRemoteNotificationType

Returns the types of notifications the app accepts.

Deprecated