Technical Q&A QA1689

Supporting orientations for iPad apps

Q:  Which orientations should my iPad application support?

A: It is strongly recommended that your application support all orientations. This includes portrait, portrait upside-down, landscape left and landscape right.

If it is essential that your application run in only one orientation (for instance, portrait only), then you should:

When you are writing your application, consider using UIKit's interface orientation macros. In your UIViewController class, you should implement

-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation to return:

Listing 1  Using an orientation macro in a portrait-only application

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    return UIInterfaceOrientationIsPortrait(interfaceOrientation);
}

For more information on orientation support, see the "Device Orientation Can Change" section on the iOS Human Interface Guidelines. See Q&A: Why won't my UIViewController rotate with the device? for possible reasons your view controller does not rotate.



Document Revision History


DateNotes
2010-12-10

Changed references of separate iPhone and iPad Human Interface Guidelines to point to the combined iOS guidelines.

2010-04-13

New document that describes the recommended orientation support for iPad apps.