Is it mandatory to use Launch Screen File to support iPhone 6/6Plus? - ios

I have only Default-568h#2x.png and Default-568h#3x.png in my bundle. When I execute the application in iPhone 6 and 6 Plus the app automatically does some scaling and displays the app utilising full screen size.
But when i use some .xib file as "Launch Screen File", the app stops scaling and does not displays for full screen, has various UI issues.
Is it mandatory to have launch file, if I need to support iOS 8 / iPhone 6 / iPhone Plus?
Is there any chance for the app to get rejected if the app does not use LAUNCH FILE?
Please let me know your comments.

You can use your storyboard for your launch screen now.
http://oleb.net/blog/2014/08/replacing-launch-images-with-storyboards/

NO.
LaunchScreen xib is a quick way to detect main screen.
Depending upon the main screen, OS runs your app and determines screen width and height.
Another approach is just to add launch images for iPhone 6 and 6 Plus instead of LaunchScreen file.
NOTE: Apple is motivating to use LaunchScreen, because it is a one file launch image. It can also be used for pads as well. Single file multi purpose.

Related

Adding a Launch Screen changes the display of my whole app

I tried adding a launch screen to my app. I tried the simplest : just add a new file of type Launch screen to my project (and do nothing more). But this seems to change the resolution of my whole application. Here are sample screens of the same controller of my application with and without the Launch Screen :
without the launch screen :
with the launch screen :
Strangely, once I have used the Launch Screen once, I need to quit and re-launch the simulator to re-obtain the original resolution.
What should I do and which resolution is the correct one to work with ? Does it have something to do with retina ?
I can copy-paste the code generated in the LaunchScreen.xib if needed.
From Apple's documentation:
You use a launch XIB or storyboard file to indicate that your app runs
on iPhone 6 Plus or iPhone 6.
By adding a launch screen you activated native support for iPhone 6 and iPhone 6 Plus. That means that your app is no longer scaled up to adapt the larger screens of the iPhone 6 and 6 Plus, but uses the full resolution of those larger screens (which IMHO is a good thing that you should do).

Remove launch screen if device version in iOS 8

I have an application which works for iOS 7 and 8 and I'm using auto layout so it will be ok on all iPhones. For iOS 7 I need the launch screen file but for iOS 8 I want to hide it.
How can I remove it specifically for iOS 8?
Thanks in advance :)
The launch screen is processed and displayed by iOS before anything else happens. You can't do anything programmatically to affect the launch screen as your code won't run until after the launch screen has been displayed.
So the only thing you can do is take advantage of the xib launch screen support introduced with iOS8, to provide two different launch screens: one for iOS8+ (the xib) and one for iOS7 and lower (the png).
In the HIG it says the following...
In iOS 8 and later, you can create a XIB or storyboard file instead of
a static launch image...
..
If you also need to support earlier versions of iOS, you can continue to supply static launch images in addition to a launch file.

not using fullscreen iOS App Xcode 6.0 iphone5s

I have a simple out of box app that doesn't use the entire screen when I deploy it on a iphone5s. By default it creates a LaunchScreen.xib. I have not edited this file on purpose.
Black Bars top and bottom
Other answers suggest to add a Default-568h#2x.png launch image, but I am not using a launch image, and I am not sure where to add these. I see a place for this in the Images.xcassets by clicking the + icon and selecting New Launch Image.
Do I need to add a New Launch Image to Images.xcassets? If so what is the point of having a LaunchScreen.xib?
Thanks!
To get the app to display full screen:
As suggested here (https://stackoverflow.com/a/15328339/4347877), you must include a Default-568h#2x.png launch image (for iOS 7 or earlier). Or if your deployment target is iOS 8 or higher, you have the option of using LaunchScreen.xib.
Why Use LaunchScreen.xib?
For iOS 7 and earlier, app developers had to provide separate launch images for all screen sizes, resolutions and orientations their app supported. For universal apps, up to seven images were required: retina and non-retina versions for 3.5-inch iPhones in portrait and for iPads in portrait and landscape; and another retina image for 4-inch iPhones (the iPhone requires no landscape version because apps are always launched from the portrait-only Home screen).
Creating these images is a nuisance. Xcode 6 comes to the rescue by allowing you to specify a storyboard whose initial view controller will then be used as the app’s launch screen.
If you want to add a launch image instead of using LaunchScreen.xib:
Click on your Images.xcassets folder, right-click in the left pane, and select "New Launch Image." Once you have the correct launch image sizes for all devices you would like to support, drag each image to its respective slot (e.g. "Retina HD 5.5" or "iPhone Portrait 2x"). Before Xcode 6 introduced LaunchScreen.xib I used to create my launch image size here: http://www.appiconsizes.com.
Okay the solution I found came from this question. The answer from James Nick Sears actually fixes my problem. This is after adding the Launch Images. It should be noted that launch images using the images.xcasset is the prefered way to do this pre iOS 8.0 and the only way to make your app compatible with devices running iOS 7 and earlier.
I suggest using TiCons to create the icons, the mapping took me longer then it should have to figure out. In xcode you can see the expected image size for each device by selecting the empty image box and looking in the attribute inspector window on right.
But the real kicker is clicking the 'use asset catalog' button on the "App Icons and Launch Images" of your apps settings under the General tab. Once you click Migrate you can select your LaunchImages from the selection menu that resides where the button used to be, after "Launch Images Source". Without doing this your app won't work correctly on pre iOS 8 devices.

iPhone 6 - app does not fill screen

Most of my apps scale up when run on an iPhone 6, but for some reason one of my apps looks like this:
What would cause it to not just scale up and fill the screen?
EDIT: Here are some repro steps:
Create a new project (Single View). Turn off size classes and just use iPhone.
Make the background orange.
Add a yellow UIView subview at (20,20,280,200).
In Xcode you get this:
Now simulate on iPhone 6. You get this:
Why doesn't it just scale up and look normal?
Not sure why this is getting downvoted. It's a legitimate question. And here's the legitimate answer:
Remove the "Launch Screen File" in Projects > General. Xcode 5 did not have this so older apps scale up automatically. Apps created with Xcode 6 get a default Launch Screen file created.
Removing it will make your app scale up on iPhone 6.
I have got the same problem and I managed to solve it by adding constraints to my ViewController in the storyboard.
Make sure that you clicked the ViewController of your scene. They yellow button in the this screenshot.
Click Editor-> Resolve Auto Layout issues -> Add Missing Constraints
Now you will find that the background image is scaled up to fill iPhone 6 or iPhone 6 plus.
Note that this solution works for me even if I did not provide any launch screen file.
I had the same issue. Searching for an answer, most of them mention the launch image. To me, what did the trick, was that I first enabled launch image for iOS8.0 and later in Xcode, which requires the native resolution sizes for 4.7" and 5.5". Adding these sizes didn't help, but when I re-disabled them, it started working!
If you do have any launch image, you will need launch images for all appropriate sizes. I was doing a minor update to an app, and it was not showing correctly on the iPhone 6 simulator. I created four launch images (.png files). Since the app should still run on iOS 7, I apparently could not use an asset catalog. I gave the images the correct names, and all is good.
Image sizes and names may be found here:
Sizes and Naming of Launch Image for iPhone app in iOS8

Simulator running in scaling mode for iPhone 6 Plus?

My app starts and runs on the new iPhone 6 Plus (or iPhone 6) in the simulator, but elements that I know are supposed to be small on the big screen (i.e. hard coded CGRects) are large, as if the whole app had just been scaled up for the larger screen.
How can I get out of scaling mode in the simulator?
It looks like setting a launch screen file in the "App Icons and Launch Images" section of your project settings, or adding iOS 8 images to your launch image catalog, will enable "native" resolution.
Adding a correctly sized LaunchImage seems to be enough (setting an incorrectly sized image won't).
Also adding the new "Launch Screen File" should work:
You must set correctly sized LaunchImages
For more information about LaunchImages and icons see this documentation
https://developer.apple.com/library/IOs/documentation/UserExperience/Conceptual/MobileHIG/IconMatrix.html
use Asset Catalog Creator from mac app store.
https://itunes.apple.com/gb/app/asset-catalog-creator-app/id809625456?mt=12
give it any image and it will generate all the correct launch images and icons in a xassets file.
This should stop the scaling of the whole app on iphone 6+

Resources