Instance Method

application(_:didChangeStatusBarOrientation:)

Tells the delegate when the interface orientation of the status bar has changed.

Declaration

optional func application(_ application: UIApplication, didChangeStatusBarOrientation oldStatusBarOrientation: UIInterfaceOrientation)

Parameters

application

Your singleton app object.

oldStatusBarOrientation

A constant that indicates the previous orientation of the app’s user interface; see Responding to App Life-Cycle Events for details.

Discussion

The delegate can get the current device orientation from the shared UIDevice object.

After calling this method, the app also posts a didChangeStatusBarOrientationNotification notification to give interested objects a chance to respond to the change.

See Also

Managing Interface Geometry

func application(UIApplication, supportedInterfaceOrientationsFor: UIWindow?) -> UIInterfaceOrientationMask

Asks the delegate for the interface orientations to use for the view controllers in the specified window.

func application(UIApplication, willChangeStatusBarOrientation: UIInterfaceOrientation, duration: TimeInterval)

Tells the delegate when the interface orientation of the status bar is about to change.

Deprecated
func application(UIApplication, willChangeStatusBarFrame: CGRect)

Tells the delegate when the frame of the status bar is about to change.

Deprecated
func application(UIApplication, didChangeStatusBarFrame: CGRect)

Tells the delegate when the frame of the status bar has changed.

Deprecated
enum UIInterfaceOrientation

The orientation of the app's user interface.

struct UIInterfaceOrientationMask

These constants are mask bits for specifying a view controller’s supported interface orientations.

class let invalidInterfaceOrientationException: NSExceptionName

This exception is thrown if a view controller or the app returns 0 instead of a valid set of supported interface orientation values. It is also thrown if the orientation returned by a view controller’s preferredInterfaceOrientationForPresentation method does not match one of the view controller’s supported orientations.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software