Programmatically load the initial view controller from storyboard IOS5

15,169

Read both of the answers provided for this question, the first approach is easier but you have to do what you just wrote you didn't, the second one is what you are looking for but its way more complicated.

iOS 5 storyboard, programmatically determine path

Share:
15,169
Jeff
Author by

Jeff

Updated on June 04, 2022

Comments

  • Jeff
    Jeff almost 2 years

    I am creating a login type functionality for my iphone app. I've laid the whole thing out in storyboard. I have set a condition that keeps the user logged in for a day. Then after that, the application should direct them to the initial view controller (a page where they have to enter login credentials).

    I was planning on putting this logic in the AppDelegate (app did load). If there is a better place to put this logic, I'd be open to that. But how do i access and load the initial view controller in my storyboard?

    The reason I can't just load a segue to this initial view, is because I won't necessarily know where the user last left the application. And i don't want to create individual segues from each view back to the initial view.

    Thanks!

    EDIT! In response to Luis's answer Okay, great! I added a navigation controller at the beginning of my starboard, like the first character suggested. Now, I'd like to go back to the navigation controller every time I open, or re-open the app, so that the navigation controller's logic executes. Thanks