Alessandro Gregolin
Alessandro Gregolin

Reputation: 69

performSegue in Swift 3 app not working

I am using Parse Server deployed on Heroku and MongoDB for my Swift 3 IOS app. When i open my home view controller I want to check if there is a user alredy logged in and if there is not I want it to perform a segue to go back to the login page. The function correctly states that there is no user logged in and also hides the log out button. The segue does not work though. Here is the image of what is happening:enter image description here

Upvotes: 0

Views: 208

Answers (1)

vacawama
vacawama

Reputation: 154583

You are trying to perform the segue before the view has appeared. Move your call to an overload of viewDidAppear.

Upvotes: 1

Related Questions