I am working with Xcode 7.2 and swift 2. I added a launch screen in the launch story board. However, when I run the app, the launch screen disappears quickly. Is there any way that I can customize the time for it?
Asked
Active
Viewed 956 times
1 Answers
0
Well you can create a whole new ViewController to display a splash screen like:
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject : AnyObject]?) -> Bool {
self.generateRandomSplashScreen()
self.performSelector("removeSplashScreen", withObject: nil, afterDelay: <Your delay in seconds>)
self.otherViewControllerLoad()
// the other view controller
self.window.makeKeyAndVisible()
return true
}
func generateRandomSplashScreen() {
splashScreenViewController = SplashScreenController(nibName: "SplashScreenController", bundle: NSBundle.mainBundle())
self.window.addSubview(self.splashScreenViewController.view!)
}
func removeSplashScreen() {
splashScreenViewController.view!.removeFromSuperview()
self.window.rootViewController = self.tabBarController
}

Mtoklitz113
- 3,828
- 3
- 21
- 40