Tobonaut Tobonaut - 1 year ago 267
Swift Question

Show version of app in launch screen with Swift


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 Source

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
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download