I have a UITableViewController that I would like people to access as the main page. I do have a login view controller but I do not want this to be my initial view controller. I have an if statement checking if the user has logged in previously. If not, I would like to perform a segue to the login view controller. When I run the app however, it goes through the if statement, recognizes that the user is == nil, and then goes right over the performSegueWithIdentifier operation.

override func viewDidLoad() {
        super.viewDidLoad()

        if user == nil {

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

        }
}

Any idea why?

Related posts

Recent Viewed