How to activate "Optimized for iPhone 6 / iPhone 6 Plus"

I’m perfectly cool with it…  B)

Thanks for the info here guys! How do I actually build the nib file from the xib?

Edit: It’s in the first post <facepalm.jpg>

How did you manage to center the logo image for every device?  Whenever I switch between iPhone 4, 5, 6, iPad, etc., the Interface Builder messes up the alignment of the image.  I don’t think I’m doing the constraints correctly.

The video that @newbieLua posted above:   http://www.youtube.com/watch?v=p5wD8dvSDbM

should show you how to build a universal storyboard and center things.  I screwed it up several times before I finally got it right.

Rob

hello @dislam, my launchscreen doesn’t align too when switching between devices inside IB.

But I lined it up with just one device and then immediately compile + build it into my project. I didn’t switch to another device inside Interface Builder… 

It actually works everywhere, my logos was lined up regardless which devices I tested on.

I must have missed something but I just opened my .nib file again and it behaves the same ---- it doesn’t line up when switching device views inside Interface Builder. And this exact file lines compiled and lines up perfectly on my devices.

And thanks @Rob for the tutorial and followups on this.

@davemikesell , did you check your General Project Settings to ensure you are indeed using the edited LaunchScreen as you build+compile the XCode project?

If you did something (ie. coloring) to the LaunchScreen in Interface Builder, and ended up with a black screen, I believe it may not be pulling the correct set… 

I can’t get the images to appear. I include them in the Corona project next to main.lua, named as they are in Interface Builder.

All I see is the background colour.

Secondly, can you just include a @2x and omit the other sizes? 

@Studycat, I’m not sure what would happen if you omit the stand 1x (and @3x) resolution… 

But to check if the naming pointers are set correctly, you can “Open As…” , “Source Code” in XCode and view the raw xml inside the .xib file.

Just make sure the name attribute in the <image> tags are correct without any prefixes and any file extensions.

ie:

\<image name="MyLogo" width="379" height="142"/\>

“MyLogo” should be pointing to the root project/app folder with a file name (to be selected by device at runtime) MyLogo.png or MyLogo@2x.png or MyLogo@3x.png

Just wanted to share that this method of manually adding the .nib file works ! 

My app has finally hit the App Store and it got tagged for the iPhone 6/6+ optimizations.

I’ll be posting my app’s info on the other board so I won’t be spamming here too much.

Hi newbieLua,

and you built your app with the latest public release?

@toga, yes my game is published with the basic build 2393a . 

I’m only on a Basic subscription, so public-builds are the only resources I have access to.

@newbieLUA

Thanks, got it working. 

I omitted the @1x and @3x and it worked fine on iPad Retina/non-Retina and iPhone6. 

I pointed LaunchScreen.nib at my iPad sized Default-Landscape.png to avoid needing to include another big image in the app. This means iOS6/7 use the same image as the iOS8 LaunchScreen.nib.

I Aspect-Filled the image on all devices using the video that you linked to previously: https://www.youtube.com/watch?v=p5wD8dvSDbM#t=104

I followed Robs tutorial and it was no problem to change the view to my liking and to generate the .nib file:

http://coronalabs.com/blog/2014/10/21/tutorial-building-multi-screen-launch-images-using-xcode-6/#comment-386849

But the images I used (“iOS8-splash.png”, “iOS8-splash@2x.png”, “iOS8-splash@3x.png”) never showed on the device.

But the .nib was working, I could see this by changing the background color for the View in the Interface Builder - change it to blue, compile the .nib, put it into the project folder, test the app on the device => before the app starts the screen goes blue, so the process works.

I then followed the suggestions of “newbieLUA” and edited the .xib file, I put the name of my splash image into 

        <image name=“iOS8-splash” width=“256” height=“256”/>

and into additionally I put it into the following imageView, otherwise it didn’t work for me:

                <imageView userInteractionEnabled=“NO” contentMode=“center” horizontalHuggingPriority=“251” verticalHuggingPriority=“251” misplaced=“YES” image=“iOS8-splash” translatesAutoresizingMaskIntoConstraints=“NO” id=“Yb4-7j-7ma”>

and I then compiled it to a .nib and it worked, the image showed up as a splash screen on my iOS 8 devices, tested with iPad Air and iPhone 6.

Best,

Andreas

@avlepel,

Are you using “@2” , “@3” or “@2x” , “@3x

The “x” in the file name matters and that could be the reason the images can’t be shown on retina devices.

Hope this helps!

Thanks so much for providing the BlackScreen.  That’ll work for me.  My apps usually load so quickly that I don’t even notice the black launch image.  I never thought it might make someone cringe. :slight_smile:  I’ll have to keep that in mind.

Dave

Like others on this thread, I could not get the tutorial to work. Basically, the nib just could not find the images in Images.xcasset and I had no idea how to fix it. 

It took a couple of hours but I ended up manually replacing “Image” with “Default-Landscape” in the .xib file (as newbieLUA suggests) and I also added some constraints to center the image on iPhone and iPad (as in the linked tutorial video.)

Since the following nib just uses the Default-Landscape (and I think Default-Landscape@2x) files in your base directory, if you have a landscape game you might just be able to copy the following nib file into your base directory, add one line to your build.settings, and get credit for being iPhone 6 compatible.

If you want to try the nib, here it is:

https://www.dropbox.com/s/yzpztnqjhn8iceg/LaunchScreen.nib?dl=0

and here’s the xib I used (it’s a text file so you can look at the contents)

https://www.dropbox.com/s/ufomkwzfew38idq/LaunchScreen_edit.xib?dl=0

Does anyone have this for iPhone vertical (no ipad)? Trying to avoid the process :slight_smile:

We did a tutorial on this.  Hope it helps some.  It gives a base project that centers an image and provides a label.  Change the label, drop in the base, @2x and @3x images, save it.  Make sure those images are in the folder with your main.lua (and it’s best to still provide the required Default-*.png images to support iOS 6 and iOS 7 as well), and you should be good to go:

http://coronalabs.com/blog/2014/10/21/tutorial-building-multi-screen-launch-images-using-xcode-6/

Rob

@Rob

It now works perfectly for me, but you might want to add the step 13b into your tutorial:

13b) Open LaunchScreen.xib file with an XML editor like Sublime 2 and change both the [image=""] inside <imageView> and [name=""] inside <image> to the base file name of your splash PNG - e.g. use [image=“Default”] and [name=“Default”] if you have a portrait project and you have the images “Default.png”, “Default@2x.png” and “Default@3x.png” inside your project folder

This step is needed because inside the LaunchScreen.xib file there is NO reference to the actual splash screen PNGs you want to use inside your project folder. LaunchScreen.xib uses a reference to “Image”, and this is the image set prepared in Xcode and placed by Xcode in the following location: /LaunchImage/Images.xcassets/Image.imageset/

But this folder is not inside the Corona project, so the files are not found on startup when the .nib is used.

But when instead of the reference to the image set “Image” you put the base file name into the LaunchScreen.xib as described, all is fine.

@jonjonsson

It would be nice to avoid the process, but if you want to have correctly scaled splash screens using the .nib you have to do it yourself.

The reason is that you might have different project settings in the config.lua:

I use this:

width = 320,

height = 480,

scale = “zoomEven”,

Because of this I use “Default.png” (320x480), “Default@2x.png” (640x960) and “Default@3x.png” (960x1440) as splash PNGs.

And I use “zoomEven” so to correctly mimic the way Corona scales the content for the different devices in the Xcode IB project I do this:

* Select “LaunchScreen.xib”

* Select the View, not the image inside, and use Mode: “Scale To Fill”

* Select the image inside the view resize it so it fills the whole view and then select Mode: “Aspect Fill”

* Add the four constraints as show in this perfect 4min-tutorial: https://www.youtube.com/watch?v=p5wD8dvSDbM#t=104

Using these settings I got a perfect match between the .nib launch PNGs and my content in my app, the scale is the same.

This is important for me, because as the splash screens I display my loading bar at the beginning, and as soon as I have the Lua control over the screen I load all my artwork while updating the loading bar step by step. So it was really important that the loading bar in the splash screens and the loading bar displayed in my apps are in the same location and are using the same size, and this on all devices.

If you use “letterbox” in your config.lua I think you would have to change the scale mode for the image in the .nib to “Aspect Fit”.

You see, it is best to do the process yourself to adapt it perfectly to your project, but by using the tutorial video and the very nice preview system for all devices inside the IB you will do this in no time. :slight_smile:

Best,

Andreas