I am completely new to iOS development and still have not managed how to accomplish such an easy task.
I have a raw xCode 4.4.1 "Single View Application" project.
I want to have, say, four screens, each having buttons for switching to other views.
Screens are not set up in a hierarchy: for example, I want to be able to switch to screen 2 or screen 3 from screen 1, to screen 4 from screen 2, and so on. On application run - the first screen is shown, but its status is not "root" or "main" - it is just a common screen among others.
My conditions are:
- I have just default main storyboard file (xib solutions are not fine).
- I don't want to rely on using Navigation controllers or similar pre-structured things.
It seems to me, that I need to somehow setup Container controller with child controllers as they are described in Session 102 from WWDC 2011, but I don't understand how to write up the code properly, so it will not conflict with main Storyboard (I have two failed attempts to use xib-based solutions from other similar topics here on SO).
I would highly appreciate a complete working example, because of my experience does not yet allow me to rely on partial hints, though they will be fine too.
A solution that will do this programmatically (not using xCode UI features like dragging) is preferred.
Thanks!
UPDATE: When switching, I don't want to instantiate new screens each time, but re-use existing ones, if they already exist.
UPDATE 2: My use case, simplified for this issue:
I have a registration screen, with corresponding modal screens to handle all common login/logout/etc situations. And I have main screen of my app, which becomes the "main" app screen after login/registration procedure is finished. I don't want to make registration screen/controller to be modal for the main screen, because the main screen pretty much depends on user-specific information, so I would like to have these screens not organized in hierarchy in any way. I think about having the following flow for this simplified situation:
1) User is not yet logged in - registration screen is presented. Later, after reg. procedure is done - switch (this is a key point I am not aware about, that is why this issue) to "main" screen.
2) User is logged in and is recognized by app - "main" screen is presented.
Having registration and "main" screens like I described excludes (or what?) the situation of having "Tab controller" functionality in "Tabbed application" template as is, because in my case I want to have tab bar completely disabled - what I need is not a nav. & nav bar functionality, but just the way to perform transition beetween reg. and "main" screens - this is what I mean "by hands" in my question.
FINAL UPDATE:
After experimenting with Tab Bar Controller, for this use-case I've ended up using Navigation Controller with navigation bar disabled (I didn't find analogous one in Tab bar controller) and managing the switching of screens by performSegueWithIdentifier method as well as switching them by manipulating viewControllers navigation stack "by hands".
Thank you all for answers!