Last active
January 9, 2016 03:20
-
-
Save agiletalk/f15d92d5edf45f2ca120 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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