How to have the master of a split view controller on the right?

What is the recommended way of setting up a split view controller so that the master is on the right and the detail on the left? I know that there is automatic support for that when the language is a right-to-left language but that's not what I'm talking about here.


I'd like to set up the master on the right in a left-to-right language (English). The master in the app I'm working on (an internal supporting tool-like app for another app) has several controls (switches, sliders, etc) which would be more easily manipulated if they're on the right (for right-handed users). Ideally, I'd like to allow the user to throw a switch to choose which side the master is on, depending on his/her handedness.


Thanks much.

Answered by Frameworks Engineer in 28843022

Hi swimmer,

UISplitViewController does not provide a way to customize which size of the screen the master view controller is attached to. That would make a great enhancement request.

Oh, and you may assume iOS 8 and above.

Accepted Answer

Hi swimmer,

UISplitViewController does not provide a way to customize which size of the screen the master view controller is attached to. That would make a great enhancement request.

Users are trained to expect certain UI features to work in a certain way. Arbitrarily tweaking a known layout goes against the HIGs and risks rejection during review. Why not work with a SVC as designed and put that effort into great content instead.

If you absolutely have to have it on the right, you won't be able to use UISplitViewController. You'll need one main UIViewController with two ChildViewControllers which you can then manipulate the frames of to give the effect of master being on the right.


But as KMT pointed out, this goes very against the HIGs and your app may not stand up during review.

This app is not for public release. It's a tool to aid in the design of the actual app to be released so it shouldn't, necessarily, be subjected to the HIGs. The primary concern here is to make it more effective for people of different handedness, and - once again - the people I'm referring to are not the general public.

This app is not for public release. It's a tool to aid in the design of the actual app to be released so it shouldn't, necessarily, be subjected to the HIGs. The primary concern here is to make it more effective for people of different handedness, and - once again - the people I'm referring to are not the general public.


It sounds like I'll have to drop the split controller then.

No need to drop it, Matt Gemmel has created a custom split view controller class that allows you to define which side is master and which is detail. Look for MGSplitViewController on Github.

Note that the code is a few years old so you'll probably have to tweak it, but faster that having to write your own from scratch.

How to have the master of a split view controller on the right?
 
 
Q