UISplitViewController displays button to change the display mode even when presentsWithGesture = false

I have a document-based app which displays a view controller with a navigation bar (i.e. it's inside a navigation controller) which is also the detail view controller of a split view controller. I'm using this sample code to just show a back button in the navigation bar of the document view controller:

class DocumentViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        splitViewController!.presentsWithGesture = false
        navigationItem.backAction = UIAction(handler: { _ in
        })
    }

}

In a regular width, this works as expected: only the back button is displayed. In a compact width such as a portrait iPhone, the split view seems to display the navigation bar button to show the master view controller (the one with the icon to the right of the back button, labeled “Root View Controller").

According to the documentation of presentsWithGesture:

When this property is false, the split view controller doesn’t install a gesture recognizer for changing the display mode. The split view controller also doesn’t display a button to change the display mode.

Is this a bug, or an error in the documentation, or am I doing something wrong?

This is kinda an edge case? Might be considered a bug.

This is specific logic to cover a case where there is a back action and a split view controller which is a fairly rare configuration. We likely forgot about this specific detail when accounting for this configuration. The goal is to ensure that developers don't accidentally prevent access to the primary column of the split view controller, since normally the back action would handle that.

UISplitViewController displays button to change the display mode even when presentsWithGesture = false
 
 
Q