Launch Image Storyboard

So in Release 2 we can now dump our launch images and apparently a mysterious invisible storyboard is used instead. It sounds like this gives us a blank launch image? This isn’t what Apple recommends. So to get what Apple recommends we need to create special views just for launch. Am I understanding this correctly?

Some of Apple’s own apps like Notes use an empty launch screen, and plenty 3rd party apps do the same- or show a logo- even though Apple advises not to show logos. It’s up to you. The launch screen/storyboard format is not officially documented. If you don’t want a blank launch screen, you can still use launch images.

Is there any way of avoiding a blank white launch screen but still keeping support for the 12.9" iPad Pro’s screen size in Xojo 2016 r2?

You can replace the launch screen that is in there with one compiled by Xcode
Its not exactly “simple” to do but it is possible
Thats the only way to do this at this time

<https://xojo.com/issue/44273> :slight_smile:

Thanks, Norm: I’ve already given my points to your case.

When you say that it’s “not exactly ‘simple’”, do you mean “basically not practical unless you really mess around with the build process” or “practical if someone who’s good with declares does the right stuff”?

Storyboards cannot be created via code at compile time… so “declares” won’t help… They need to be built with Interface Builder (Xcode), or a 3rd party tool (of which I am unaware of any at this time)

Thanks for the clarification, Dave.

You’ll have to compile one in Xcode then copy the compiled launch screen into the app replacing the original one

It should get simpler in time - just cant say when

Today I tried to upload a new version of an iOS app already on iTunes. I made some minor interface changes to the app. I did not delete the launch images from the project. I am using Xojo 2016 r2. This is the error message I got regarding launch images/story boards.

I’m struggling to find the forum thread where I learnt about this error, but it’s essentially a case of needing to specify in your Info.plist file that your app doesn’t support iPad multitasking features.

See the ‘iTunes File Sharing’ heading on the following page for information about using an Info.plist file: Xojo documentation

You need to set the UIRequiresFullScreen option in your plist:

[code]<?xml version="1.0" encoding="UTF-8"?>

UIRequiresFullScreen [/code]

Just a detail, Thomas. DropBox does not seem able to server images as a web site would. Instead of trying to use the image option, just post the link.

https://xojo.io/3d5917d5d206

Has anyone built a new Launchscreen.storyboard or LaunchScreen.XIB file?
Since it can’t be built in code, and I need one… I have been fighting with Interface Builder for days and cannot get it to work
It is rather simple… 3 labels horizontally centered, and one image centered in the view.
I stumbled around blindly and finally ended up with setting that work in the simulator (I only have an iPad2 to test on)
and it displays properly in both Port and Landscape

EXCEPT on the iPadPro simulator… it is fine in Landscape mode, but all the labels are NOT horizontally centered in Port mode

plus I get “Frame for will be different at run time” for each label and image

[quote=278280:@Tom Catchesides]Thanks, Norm: I’ve already given my points to your case.

When you say that it’s “not exactly ‘simple’”, do you mean “basically not practical unless you really mess around with the build process” or “practical if someone who’s good with declares does the right stuff”?[/quote]

Not simple in “you have to do a decent amount of mucking about and use Xcode”
Declares CANT do it as this is loaded by the OS before your app has really started

  1. open Xcode and create a launch screen (I’m using Xcode 8)
    in Xcode File > new File
    in the template chooser at the top left choose iOS
    select “LaunchScreen”

(or write it by hand as an xml document - yuck - so we’ll assume youre going to use the Xcode template)

  1. layout whatever controls - note there are serious restrictions on what kinds of controls you can use
    no web views etc
    labels & images are probably all you really need / want

these are ones I’ve gleaned from other developers experiences
[i]
The app is not yet loaded so the view hierarchy does not exist and the system can not call any custom view controller setup code you may have in the app

The launch screen can only use basic UIKit views such as UIImageView and UILabel. You cannot use a UIWebView.

Localizing the launch file does not currently seem to have any effect. The base localization is always used so you will probably want to avoid text on the launch screen.

You cannot specify different launch files for iPad and iPhone. This may be a problem if you have significantly different interfaces for those devices as there is only so much you can do with auto layout and size classes.
[/i]

  1. save

  2. note you cannot compile this storyboard in Xcode

  3. compile this storyboard by hand using ibtool
    xcrun ibtool —compile <inputfile from step 2>
    This will generate a DIRECTORY with a few items in it
    IF you name the output directory “LaunchScreen.storyboardc” it will make life a tad easier

  4. in your BUILT iOS app replace the contents of “Base.lproj" with the one compiled in step 5

  5. test like mad & this should replace the default launch screen

EDIT - revised step 5 (about naming the output directory) and also step 6
Removed step 7 as its no longer needed because of changes to step 5

IF you put an IMAGE View on the launch screen you cant quite completely set it up in Xcode (if you’ve followed the previous steps) since there is no project for you to add assets to
You CAN still put the “image name” into the property for the image view and set it to scale to fit etc etc in Xcode
And then make sure you add another copy file step to add the require image(s) to the built apps “resources” folder
if the names match up then the images will load
if not they wont

again test like mad

until we have a system in place in the IDE to make all this unnecessary :slight_smile:

What I was able to do is saving a Xcode storyboard in my Xojo project folder (let’s call it LaunchScreen.storyboard). Then, put the following script BEFORE build step in your iOS build settings:

Var command As String
command = "cd ""$PROJECT_PATH"" &&rm -rf ./Base.lproj/*"
Var result As String
result = DoShellCommand(command)
command = "cd ""$PROJECT_PATH"" &&ibtool ./LaunchScreen.storyboard --compilation-directory  ./Base.lproj"
result = DoShellCommand(command)

Then, add a CopyFile step to your Build Settings, but AFTER the Build step. Configure it to copy file from ./Base.lproj/ to the home directory of your app (because Xojo will put its storyboard in “(app root)/Base.lproj”, and this will copy the whole directory to the app root directory).

The script is to recompile the LaunchScreen.storyboard every time, and the CopyFile step will substitute the LaunchScreen.storyboardc in (app root)/Base.lproj. Though I put the script before Build, I believe this can work as long as the script is before the CopyFile step.

Using this I was able to create a launch screen supporting both normal and dark mode (which Xojo itself does not support, and I hope it can support this someday). In fact, I also wrote a script before Build step to xattr -cr the project root in order to prevent the annoying dialog box telling me there is something wrong with the finder (which Xojo itself should do, or at least give an option).

Hope this helps.