Locking the app orientation

By default, the app orientation changes according to the orientation of the device. You can configure the iPad app to ensure that the orientation for the app is set specifically.

Perform this task in the copy of the DeploymentKitApp in Xcode on your computer.
Note: You can customize most settings in Root.plist by editing key and value pairs in the Property List view in XCode. Optionally, you can edit the XML directly in the Source Code view. To work in the XML view, right click the file name, and then click Open As > Source Code.

Procedure

  1. In the Navigator, open the file DeploymentKitApp/Settings/Settings.bundle/Root.plist.
  2. In the Property List view , find and expand the key labelled Toggle Switch - Lock Rotation.
    Key Type Value
    Item 3 (Toggle Switch - Lock Rotation) Dictionary (4 items)
    Type String Toggle Switch
    Title String Lock Rotation
    Identifier String lock_rotation
    Default Value Boolean NO
  3. Set the lock_rotation value to YES, and then save and close the file.
    Note: In the Source Code view, this section appears as follows.
    <dict>
       <key>Type</key>
    			<string>PSToggleSwitchSpecifier</string>
    			<key>Title</key>
    			<string>Lock Rotation</string>
    			<key>Key</key>
    			<string>lock_rotation</string>
    			<key>DefaultValue</key>
    			<false/>
    </dict>
  4. In the Navigator, open the file DeploymentKitApp/Supporting Files/DeploymentKitApp-Info.plist.
  5. In the Property List view, find and expand the key labelled Supported interface orientations.

    This key has four values, each describing a valid orientation.

    Key Type Value
    Suppported interface orientations (iPad) Array (4 items)
    Item 0 String Portrait (bottom home button)
    Item 1 String Portrait (top home button)
    Item 2 String Landscape (left home button)
    Item 3 String Landscape (right home button)
    Note: In the Source Code view, this section appears as follows, specified by the key UISupportedInterfaceOrientations-ipad.
    <array>
       <string>UIInterfaceOrientationPortrait</string>
       <string>UIInterfaceOrientationPortraitUpsideDown</string>
     		<string>UIInterfaceOrientationLandscapeLeft</string>
    	 	<string>UIInterfaceOrientationLandscapeRight</string>
    </array>

    When all four values are in the configuration, the lock rotation setting in Root.plist is ignored, and the app locks to the current device orientation.

  6. Remove the values corresponding to the orientation(s) that you want to remove from the app orientation.
  7. Save and close the file.