0
votes

I have a SplitViewController based iPad app.

The app is pretty standard - the DetailsVC is always displayed, and the masterVC is displayed only on landscape mode. The masterVC is a navigationController containing a view of mine, and the DetailVC is a vc that has a toolbar. All standard.

I want, when the app is in portrait mode, to add a button to the portrait toolbar, that, when clicked, pops up the MasterVC using Popover.

However, I don't want this toolbar button to show up when the app is in landscape mode.

What is the smartest, easiest way to do this? Again, all pretty standard, so I assume I'm just missing something.

Thanks!

EDIT:

I'm not sure if it makes a difference, but my SplitViewControllerDelegate is the MasterViewController

EDIT #2:

I almost managed to do what I wanted - all is working but the way the popover is displayed.

Some images to visualize the app:

Landscape Mode: enter image description here

Portrait Mode: enter image description here

Portrait Mode after clicking toolbar button: enter image description here

This is almost the way I want it - I just want the Menu to show as a popover of the toolbar button instead of the way it does. Image to visualize the way I want it to show:

enter image description here

1

1 Answers

0
votes

I don't think you can bend the split view controller to your requirements. This controller is really for convenience to produce this standard UI setup. If you want to deviate from this, just roll your own. It is quite simple:

Just create a view controller to control your menu view and detail view controllers (i.e. a "controller of controllers", just like the split view controller). Your detail view is a standard view controller that you can embed into a navigation controller if you want a navigation bar. For the menu / master view controller, put your own table view controller into a popover (Portrait) or the left subview (Landscape) of your main controller and make the detail view controller its delegate to be able to react to selections.