Skip to content

Instantly share code, notes, and snippets.

@agiletalk
Last active January 9, 2016 03:20
Show Gist options
  • Save agiletalk/f15d92d5edf45f2ca120 to your computer and use it in GitHub Desktop.
Save agiletalk/f15d92d5edf45f2ca120 to your computer and use it in GitHub Desktop.
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch.
let duration = 2.0
let launchScreen = UIStoryboard(name: "LaunchScreen", bundle: nil)
let launchViewController = launchScreen.instantiateInitialViewController()
let imageView = launchViewController?.view.viewWithTag(100) as! UIImageView
imageView.image = UIImage.animatedImageNamed("win_", duration: duration)
self.window?.rootViewController = launchViewController
let delay = duration * Double(NSEC_PER_SEC)
let time = dispatch_time(DISPATCH_TIME_NOW, Int64(delay))
dispatch_after(time, dispatch_get_main_queue()) {
let mainScreen = UIStoryboard(name: "Main", bundle: nil)
let mainViewController = mainScreen.instantiateInitialViewController()
self.window?.rootViewController = mainViewController
}
return true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment