How can an app access the XIB or storyboard used for its launch screen? The XIB is not in the main bundle (ex: NSBundle.mainBundle().pathsForResourcesOfType(nil, inDirectory: "")
). This is especially unexpected since "Launch Screen.xib" is listed in the "Copy Bundle Resources" build phase but doesn't show ip in the bundle, so Xcode must be treating it specially.
If LaunchScreen is storyboard
and not a xib
, Use the following code.
let launchScreen = UIStoryboard(name: "LaunchScreen", bundle: nil).instantiateInitialViewController()
if let launchView = launchScreen?.view {
view.addSubview(launchView)
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With