user1247867
user1247867

Reputation:

Segues are not performed

I'm developing a login view. I'm using Parse for the backend. The idea is very regular. If the user has registered already the app lets him in with no additional inconvenience. I put this code in viewDidLoad():

override func viewDidLoad() {

        super.viewDidLoad()

        if PFUser.currentUser() != nil {

            self.performSegueWithIdentifier("login", sender: self)

        }
    }

After the app is compiled, it goes through that block of code but the login segue are not performing. Please let me know your suggestions what's wrong with? Thank you so much in advance!

Upvotes: 0

Views: 69

Answers (1)

Christian
Christian

Reputation: 22343

It isn't possible to perform a segue in the viewDidLoad method.

Move it into the viewDidAppearmethod and it will work.

Upvotes: 2

Related Questions