I have been working on an iOS application for sometime now, and I think I am not using the View Controllers I have created properly with the storyboard file / scenes I have created for my application.
As it stands, I have two storyboard files, one for the iPhone, and another for the iPad. In the AppDelegate implementation file there is a method called,
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
I have been loading a ViewController from within this method to start the load process for my application.
Since I have two storyboard files now, I sourced some conditional code to load a specific storyboard file based on the device that is running the application.
What is the proper way to load the storyboard file?
After I load the story board file do I initialize the root view controller?
Once my root view controller is loaded should it load the elements specified in the root scene?
If I choose to load another scene from the root scene by clicking on a button in the root scene should I dismiss the root scene, and load the new scene, or is the new scene a subclass of the parent scene? What is the proper way to transition between scenes?
Basically I have a separate view controller for every scene in my application, and I have specified a view controller associated with each scene in IB.
Right now I have a button that can be pressed from the beginning / root scene to load another scene which is associated with another view controller. In this new scene I have a done button which segues back to the root view controller.
If I were click these two buttons repeatedly by clicking on the buttons over and over, am I creating new objects of my view controllers or I am reusing the objects that were already created?
I know this is more than one question but I am trying to get a good grasp on view lifecycles, and how view controllers relate to scenes, and the proper way to load the first view controller, which should load the first scene in an application I presume.