In my universal app with a split view controller at the top of the hierarchy, I want a tab bar controller with multiple table view controllers as the tabs. What should the storyboard and relationships look like?
I started with the default empty universal master/detail project. I got the standard split view controller with two navigation controllers pointing to the master table view controller and detail view controller. If I embed that master table view controller in a tab bar controller, that table view controller's detail view (actually, the detail view's navigation controller) remains the split view controller's detail view. When I add another table view controller and make it a tab of the tab bar controller, how to I hook that table view and its detail view to the split view controller? Whew.
Thanks!
...R
If I understand your desired structure properly, the graphic below should illustrate the relationships you want. (Direct Link to Full-Res Image: http://cl.ly/image/0S3y3V3O0930/Screen%20Shot%202015-05-21%20at%202.28.29%20PM.png)
Related
I'm working to migrate an existing project with a standard table view to use the UISplitViewController methodology. The standard table view is also linked to a Tab Bar Controller.
The hierarchy is as follows:
Tab Bar Controller > SplitViewController > MASTER: NAVIGATION CONTROLLER > TABLE VIEW;
SplitViewController > DETAIL: Navigation Controller > TABLE VIEW;
When I tap on a cell in the master view controller, it causes a segue of the view I want loaded in the detail view area to be in the master view controller table view area. In essence, the detail view controller loads in the master view window area.
I've validated that all connections are made correctly, but I don't know why this is happening. Any insight would be appreciated!
Not sure if you ever got to the bottom of this or not but I just ran into the same issue and thought I'd explain how I fixed it incase anyone-else comes across it.
Basically make sure that the detail view controller is linked in your Split View Controller in the storyboard before linking the cells selection segue to the detail view controller.
Recreating the segue between the cell and the detail view controller was enough to fix this for me after I'd set the split view controller correctly.
Hope that helps,
Richard
I have a Split View controller set up in Storyboard, and I need to be able to change the Detail View Controller dynamically. By default, the Detail View Controller has a "relationship" segue to a Navigation Controller, which leads to the original Detail View Controller. How can I dynamically change this relationship to another controller?
You can do this a couple different ways. If you want to do it all in storyboard, you can create a segue from your master view controller buttons or cells to your detail view Controller and choose the "replace" segue option. You can also do this in code where your master view controller stores a reference to the detail view controller (UINavigationController) and replace out the root view controller.
I'm wanting to create a UI where I have a popover that comes from a button that and contains a split view UI with two table view controllers side by side.
The storyboard I have now has a normal page with a button, the button has a popover segue to a split view controller.
The split view controller has a master relationship to a navigation controller which has a root view controller of a table view controller.
The split view controller has a detail view controller to another navigation controller which again has a root view controller of a table view controller.
When I launch the pop up it only ever displays the master controller, not the two side by side.
UISplitViewCpntroller can only be the root view of an app - as such, you cannot put them in a UIPopover or any other non-root view.
You would have to create your own UISplitViewCpntroller type view (or look for some open source code).
I created master-detail template for the ipad application and now I want to add Tab Bar to either master view or detail view. I can easily add tab bar controller using editor->embed in ->tab bar controller. However when I run application tab bar is not showing.
Tab bar is showing in storyboard but I am also unable to add extra tab bar items. What am I doing wrong thanks?
You should embed the navigation controller (of either the master or detail VC) in a tab bar controller, then delete the connection between the split view controller and that navigation controller. Finally, remake the connection from the split view controller to the tab bar controller. You'll also need to make several code changes, because the template code refers to the detail controller by its hierarchy in the split view controller, which will now be different.
Can we implement split view controller in a normal view controller as in my application we are implementing a tab bar controller and we need to put this split view in some other view and not in window because i just need to know if we are not making a split view based application can we put split view controller in any separate view but not in appdelegate(Window) If Yes please give me possibe solution...
Yes, this would work if you added it to a tab bar controller. Just create all the files for the split view just like XCode sets up a split view project and add the split view controller as a TabBar item just as you would any other view controller. I wouldn't recommend adding the the split view controller in any subview of a view controller in your tab bar as it will not to receive many useful lifecycle events.