Posts Tagged ‘SplitView’
Combine TabBar and SplitView
Example iOS project for iPad using both TabBar and the SplitView Controller.
Steps to create the project:
- Create project using the SplitViewController project template
- Create project using the TabBar project template
- Copy the RootViewController.* and DetailedViewController.* files from the SplitViewController project into the TabBar project
- I renamed the DetailedViewController.* files into ThirdViewController.*
- Open the MainWindow.xib of the TabBar project and add the third tab, the connection to the ThirdViewController will be handled in the code
- Apply the necessary changes to the SplitViewController application delegate files (see the example project)
- Add the makeSplitViewController method to initialize and connect the SplitViewController to the third tab
- Add the methods to handle showing and hiding the SplitViewController button in the navigation bar. These methods are called at several places e.g. when the TabBar is clicked, for the SplitViewController the orientation is checked and if necessary the button is hidden/shown
Now build and run the project
Updated May 5th, 2011: The example project is based on the article written by Mark Zangfound found on the iPhone Dev SDK forum. In addition I used some stuff from Greg Combs to handle rotation correctly. This code example is provided as the forum provides no sample and the discussion could confuse some programmers. I think an example tells a lot more and can be studied.
Download the example for TabBarWithSplitView testend with XCODE 4.3 here…