Tobonaut Tobonaut - 3 months ago 64
Swift Question

Show version of app in launch screen with Swift

Scenario

I want to show the version of my iOS 9 app made with Swift.

What I did

I know how to get the version (

let version: String = NSBundle.mainBundle().infoDictionary!["CFBundleShortVersionString"] as! String
)

I also have a custom label on my home screen.

My problem

My problem is now, that it is not allowed to use your own UIViewController for the splash / launch screen.

Many apps show their version right on that screen. That's why I think that there must be a way how to do it.

Answer

Its not allowed to use any UIViewController in LaunchScreen thus what other applications does is place a UILabel in LaunchScreen xib/Storyboard and write their version number as text.

There is no other away, don't waste your time searching you will get the following error if you tried to set custom class :

error: Illegal Configuration: Launch screens may not set custom classnames