Skip to content

Instantly share code, notes, and snippets.

@marciok
Last active August 29, 2015 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marciok/5b5324d0f5c1bc86ee7b to your computer and use it in GitHub Desktop.
Save marciok/5b5324d0f5c1bc86ee7b to your computer and use it in GitHub Desktop.
public class PonyTabController: UITabBarController {
override public func viewDidAppear(animated: Bool) {
super.viewDidAppear(animated)
let userDefaults = NSUserDefaults.standardUserDefaults()
if !userDefaults.boolForKey("appIntroHasBeenPresented") {
let storyboard = UIStoryboard(name: "Main", bundle: NSBundle.mainBundle())
let appIntroViewController = storyboard.instantiateViewControllerWithIdentifier("appIntroViewControllerID") as! AppIntroViewController
appIntroViewController.delegate = self
self.presentViewController(appIntroViewController, animated: true) {
userDefaults.setBool(true, forKey: "appIntroHasBeenPresented")
}
}
}
}
extension PonyTabController: AppIntroDelegate {
// MARK: - AppIntroDelegate
public func appIntroDidFinish(appIntro: UIViewController!) {
// Dismissing app intro
dismissViewControllerAnimated(true, completion:nil)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment