I am designing an iPhone App wherein I would like there to be a main screen. I then want users to be able to hit an info button in the bottom right of this screen and enter an entirely different interface that will handle options and various forms of data display.
After some research on View Controllers in Apple’s documentation, I have determined that I definitely want to use a modal view when the info button is pressed. My problem, though, is that the interface that fits best is a UITabBarController. I’d like to have a tab in my UITabBarController that represents the main screen and, when touched, will tell the main screen to dismiss the UITabBarController.
I have seen quite a few examples on the web where people add custom view controllers with buttons that trigger the modal view dismissal to tabs on the UITabBarController, but I would like to entirely avoid displaying an extra view. As soon as the user touches the main screen tab, I’d like the modal view to dismiss. I have already experimented with approaches that placed the main screen in the UITabBarController, and was not satisfied, so I’m hoping somebody out there is familiar with the rare modal UITabBarController design and can offer me some guidance.
Is this at all possible? If not, how can I accomplish the same interface flow in a different way?
I haven’t tried this yet, but is there a way I could set the UITabBarController up with an empty UIViewController to represent the main screen and call on a UITabBarControllerDelegate to send the dismiss message to the main screen before the empty view appears?
Ok, I figured this out. I admit this is probably not the most orthodox UI design, but I think it does make intuitive sense… somebody should probably link me to the Apple UI guideline that this violates, though.
The following code will allow a user to press an info button that will animate the presentation of a modal UITabBarController. In this example, the UITabBarController has only one tab and the tab bar has not been set up with icons or titles. Once in the modal view, the user can click the first tab in the bar and the modal view will be dismissed. (This logically means that you’ll want to tell the UITabBarController to start at an index other than the first.)
I am now, however, getting a warning about two-stage rotation animation:
Preliminary research said that it was because I was using a
UIImageViewControllerto display a background on my mainScreen view, but I have since changed that toUIColor initWithPatternImage. Anybody know how to get rid of the warning– or if it even matters to ignore it?