Skip to content

Instantly share code, notes, and snippets.

@chenr2
Last active August 29, 2015 14:25
Show Gist options
  • Save chenr2/8787903c1c160a0d5cb0 to your computer and use it in GitHub Desktop.
Save chenr2/8787903c1c160a0d5cb0 to your computer and use it in GitHub Desktop.

Error when performing segue on viewDidLoad

Getting this error message:

Presenting view controllers on detached view controllers is discouraged

This is happening because you’re not supposed to perform a segue until viewDidAppear

override func viewDidAppear(animated: Bool) {
    performSegueWithIdentifier("OpenThisSegueImmediately", sender: nil)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment