UIDocumentBrowserViewController and UISplitViewController

Is there any acceptable way to use a subclass of 'UISplitViewController' for displaying a document selected with 'UIDocumentBrowserViewController' as both are apparently required to be root view controllers?

Technically, it's doable. Replace the view that would show your document with a "container view" from the IB objects palette. Then create a new split controller scene in your storyboard, and connect from the container view to the split view controller using an "embed" segue.


Whether it's frowned-upon UI is hard to say. I've done this using a tab view controller as the root view controller, where it seemed perfectly natural to have a split view for the rest of the screen. Your idea isn't obviously bad, but make sure you test usability to see whether screen real estate becomes a problem or there are other usability issues in practice. If so, a navigation controller might be a better choice.

Note the the one condition where SVC can be used and not be root is when it is part of a Tabbar VC. See this link for 'order of containment':

https://developer.apple.com/library/prerelease/ios/documentation/WindowsViews/Conceptual/ViewControllerCatalog/Chapters/CombiningViewControllers.html


As for SVC, Justin from Apple here on the forumsaid this about that "As of iOS 8, embedding a Split View Controller in a tab bar controller (or your own container view controller) is supported and expected to 'just work'. Pushing a split view controller onto a navigation stack remains unsupported."


As for UIDocumentBrowserViewController, Apple confirms what you stated and says this about that...

-=-

Important

Always assign the document browser as your app's root view controller. Don't place the document browser in a navigation controller, tab bar, or split view, and don't present the document browser modally.

If you want to present a document browser from another location in your view hierarchy, use a

UIDocumentPickerViewController
instead.

-=-


So, which do you prefer as root, and optioonally, how do you feel about a UIDP VC?

Split view controller can perfectly well be a fullscreen presented view controller which is all that matters. The document browser view controller is the root view controller; your document is shown in a presented view controller.

Stumbled across this 3-year-old post looking for something else.

My app (Storyist) uses a UISplitViewController to display a document selected from UIDocumentBrowserViewController on both iPad and iPhone since iOS 12.

The only issue is that navigation bar icons are not automatically dimmed when popovers are presented.

Steve
UIDocumentBrowserViewController and UISplitViewController
 
 
Q