iPhone OS Reference Library Apple Developer Connection spyglass button

Version: 1.0

Posted: 2009-04-23

Build Requirements: Mac OS X 10.5.6 or later, iPhone SDK 3.0

Runtime Requirements: Mac OS X 10.5.6 or later, iPhone SDK 3.0

View Source Code:

Download Sample Code (“AlternateViews.zip”, 22.3K)



Description

Demonstrates how to implement alternate or distinguishing view controllers for each particular device orientation. Through the help of the following UIViewController properties, this can be easily achieved -

@property(nonatomic,assign) UIModalTransitionStyle modalTransitionStyle; // for a transition fade

@property(nonatomic,assign) BOOL wantsFullScreenLayout; // for any view controller to appear over another

This sample implements a two different view controllers one for portrait and one for landscape. The portrait view controller listens for device orientations in order to properly swap in and out the landscape view controller. It uses the above two properties to achieve the visual cross-fade effect.

Document Revision History

Date Notes
2009-04-23Demonstrates how to implement alternate or distinguishing view controllers for each particular device orientation.
Did this document help you? Yes It's good, but... Not helpful...