I have an app with a TabBar.
One of the TabBar-connected views is actually variable:
Upon first opening of that view, it shall show a login dialog. If the user logs in, the login view is finished and the actual data view is shown.
Later, if the user goes back to this tab, the data view shall appear right away, so no more login dialog view.
Until now, I've solved this by directly manipulating the tab bar item's navigation controller's view controller array: Initially, it is set to show the login view. Once the user has logged in, the login controller is removed from the navigation controller and the actual data view is inserted instead.
I am not happy with this solution, though, as it causes problems once there are more than 5 tab items.
Hence, I wonder how I can avoid this navigation controller "patching" and instead have a new root controller for this tab that will then either invoke the login view or immediately show the data view.
Note: There are design reasons why the data view can't just pop up a modal view controller for the login. Therefore, I really like to provide something like a proxy controller that can direct the functionality to one of two other controllers of its choice.
How would I accomplish that?
Or are there other concepts I employ use here?