0

I am new to iOS programming, and I'm trying to do something very basic. I want the first screen in the app to be different for logged in users, and not logged in users. I am currently using the following code in my main ViewController:

if (token == nil) {
    // don't do anything
} else {
    // logged in, so show the second page
    UIViewController *loggedIn = [self.storyboard instantiateViewControllerWithIdentifier:@"LoggedInViewController"];
    [self.navigationController pushViewController:loggedIn animated:NO];
}

This works, but I'm wondering if I'm following proper iOS programming conventions. Is there another, more "standard" way of doing things?

Sam Lee
  • 9,913
  • 15
  • 48
  • 56

1 Answers1

0

Your method is fine, otherwise you could use Segues as explained here: Apple docs

Check this answer: https://stackoverflow.com/a/21205550/2059307

Community
  • 1
  • 1
Jacopo Penzo
  • 2,168
  • 2
  • 24
  • 29