Instance Method

application:willChangeStatusBarOrientation:duration:

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

Declaration

- (void)application:(UIApplication *)application willChangeStatusBarOrientation:(UIInterfaceOrientation)newStatusBarOrientation duration:(NSTimeInterval)duration;

Parameters

application

Your singleton app object.

newStatusBarOrientation

A constant that indicates the new orientation of the app’s user interface; see Responding to App State Changes and System Events for details.

duration

The duration of the animation to the new orientation, in seconds.

Discussion

The delegate typically implements this method to prepare its windows and views for the new orientation. The delegate can get the current device orientation from the shared UIDevice object.

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

See Also

Managing Interface Geometry

- application:supportedInterfaceOrientationsForWindow:

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

- application:didChangeStatusBarOrientation:

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

- application:willChangeStatusBarFrame:

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

- application:didChangeStatusBarFrame:

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

UIInterfaceOrientation

The orientation of the app's user interface.

UIInterfaceOrientationMask

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

UIApplicationInvalidInterfaceOrientationException

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.