There are a bunch of helpful key-value entries you can put in the Info.plist file of your iPhone app.

These are pretty well documented on the Apple site, but if you’re like me, you had a really hard time finding them. I decided to post the most useful ones here for easy access.

lines

General

First you need to know how to add and manipulate values in the info.plist file. The file lives under the resources bundle in XCode. When you select this file, the contents of the file will appear on the right. Highlight an entry, and a ‘+’ will appear. Click on the ‘+’, and new line will appear. Now enter the name of the key that you want to set.

To set the value type, right click the key name, and highlight ‘Value’. The options will appear on the right. The default key type is String.

UIStatusBarHidden

This is a boolean value that, when set to yes launches the application with the status bar hidden. Another way to do this is under the method ApplicationDidFinishLaunching method in the application delegate. In this method, you can add the line

[UIStatusBar setHidden:YES];

This will hide the status bar, but only after the application has, well, finished launching. Meaning your splash screen will come with a status bar for the majority of its appearance.

UIInterfaceOrientation

This is a key with a String value. The available options are the orientation options for the iPhone. This is the key you need to set if you want the application to launch in landscape. The default value here is standard portrait

(UIInterfaceOrientationPortrait)

If you want to launch the application in landscape, use UIInterfaceOrientationLandscapeLeft or UIInterfaceOrientationLandscapeRight.

You can also launch upside down using UIInterfaceOrientationPortraitUpsideDown.

These values are the available orientations for the phone throughout the application.

UIPrerenderedIcon

When you put your 57×57 icon in the application, you’ll notice that when it gets to the springboard, it has an added shine effect and looks glossy. Well, sometimes you don’t want that. Rami (the designer) can probably explain why better than I can, but you basically sometimes want to control what will show up on the springboard. This is a boolean key that when set to YES, turns off that render effect.

UIRequiresPersistentWiFi

This is a Boolean key that when set to YES, will operate a WiFi connection when the application launches. Use this if your application doesn’t work without WiFi. This is especially helpful with displaying an error to users when no WiFi is available. Apple are careful that you notify your users of WiFi (read - they’ll reject your app if you’re not), and as this key opens the connection on launch, it takes care of user notification for you. If this value is set to NO, which is the default, the OS will close any active connection after 30 minutes.

UIStatusBarStyle

This is quite easy to set up using the Interface Builder, but its an option, so I’ll cover it. The value is a String type, and it defaults to UIStatusBarStyleGray. The other options are UIStatusBarStyleDefault (Gray), UIStatusBarStyleBlackTranslucent, UIStatysBarStyleBlackOpaque. You can see what each one looks like in the Interface Builder.

There are more, but I think that these are the most useful ones. For more info, check out the full documentation at the iPhone developer center. Thanks for reading.


SPEAK / ADD YOUR COMMENT
Comments are moderated.

Return to Top

FRESH / LATEST POSTS