Designing the UI when you need to use a SplitViewController


#1

In the app we created utilizing the SplitViewController in this chapter, we used a tableView for both the master and detail views. This was fairly easy to implement from a design view as the tableview does the view payout. However, what if you want the detailView to be more complicated with labels, maybe a graph, data etc.? How does one use Interface Builder to design this interface? Do you have to use the pre-formatted SplitViewController object? I’ve started really liking doing this stuff programmatically and feel like it is taking a little bit of a step backwards if I need to use the templates.


#2

I haven’t received a response to my question, so I’ll put it slightly differently. I want to build an app that most likely will use a splitview controller, though that isn’t necessary. However, my detail view will not be a table. In fact, it will have several different layouts depending on what the user is doing. I’m starting to think that this is best handled by using interface builder. The book actually said as much when you need to have a view with more than a few subviews. Interface Builder was used minimally and Story Boards even less so. With the number of different layouts and transitions, i.e. segues, I’m wondering if I should consider using Story Boards? I’m pretty sure I’ll need to use IB anyway. The book sort of demeaned the use of Story Boards so I’m just wondering if I’m making a good decision to try and use SB.

Any suggestions?


#3

You could have several view controllers (including a split view controller), individually designed in IB, and you could swap views in and out depending on what the user does. But, of course you can always use a navigation controller if you don’t like the idea of swapping views in and out.


#4

Thanks, ibex10. So am I correct in that you wouldn’t recommend story boards either?

Here’s the issue I think I’m dealing with. If I construct a view in IB using just a standard view template for iPad and then insert that view into a splitview controller, the left to right dimensions will be quite different. How do you deal with this? Springs and Struts? Or is it better to build the view in a splitview controller? I suppose if you set the Springs and Stuts properly it should work fine? This way I could build the interface for the classes individually and then insert them programmatically into the splitview container.


#5

You can override the resizing behaviour of views (it is not always straightforward though).
See Configuring the Resizing Behavior in UIView class reference.
Now is the time to go deeper into the view programming topics!

As for the storyboards, I have used it only once and I was not fully convinced of its benefits.


#6

ibex,

I also tried using storyboards and to be honest I thought it was a bit more confusing. For instance if a selection leads to a different view depending on the cell selected it seemed less straightforward than simply programming the actions.

If you have some time would you look at the couple of questions I have posted in this section regarding the splitview controller?