Why wrong window size:

Using XCODE7 and iOS9 on an iPhone 5 shows the app with 320x480 size:


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];


Debugging self.window says: frame is (0,0,320,480) on an iPhone 5 Model !?


Is there anything else to do ?

The app was running correctly under iOS8.

Replies

Letter boxing is happening for apps built against the iOS 8.4 or earlier and currently in the store, if they are localized apps. Not only that, but I can't see a way of fixing it in iOS 9. The app appears letter boxed if the launch image for the app is in a localized folder ('en or 'de' for example). Do you have any suggestions?

We don't support localized launch images. You will need to move them into the main bundle. We recommend removing all localized elements from a launch image for this reason.


Alternatively for supporting iOS 8 or later you can use a Launch Screen, which is a nib or storyboard that can provide UI elements that can also be localized.

That fixed the problem, Thanks!

That's a surprise - we've been making apps with localized launch images since 2009 and they've worked perfectly until now. I had no idea that they were not supported. Thanks for your quick reply, at least I can fix the apps now.

The decision of suddenly removing support for localized launch images, especially since the distinction between iPhone5 support is done by checking whether a launch image of a certain name exists, is really, really strange. It breaks all existing apps that have localized the Default-568h launch image: Suddenly all such existing apps are launching in iPhone4 mode (and, depending on how they detect the screen size, may become badly clipped).


These apps suddenly showing just a black screen at launch instead of their usual launch image is a minor cosmetic problem. They suddenly starting in iPhone4 mode (while still possibly thinking that they are running in iPhone5 mode) is a major breakage of these existing apps.


Yes, this happened to us, without any warning. Our existing app on the AppStore suddenly broke this way when running it on iOS9.

Happens to work (which I cannot confirm) and supported are two very different things. The documentation specifically states that launch images are not localized here: <https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/LaunchImages.html> Specifically the statement "Text. The launch image is static, so any text you display in it won’t be localized"


They may have happened to work due to implementation details, but I'm certain those details have varied over the years, and as such it is likely that them working was incidental rather than intended.


I'm sorry this happened to your application, but this is not considered either broken or a revocation of functionality, as this functionality was never intended.