Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UISplitViewController displayModeButtonItem not displaying

Tags:

ios

splitview

I am not able to get iOS to display my button to show the UISplitView master view when in portrait mode (iPad) or landscape (iPhone 6+).

Right now I am using the following code, but it's not doing anything...

    detailViewController.navigationItem.leftItemsSupplementBackButton = true
    detailViewController.navigationItem.leftBarButtonItem = displayModeButtonItem()

I tried putting that in the viewDidLoad() of my UISplitView subclass or in the viewDidLoad() of my detail main navigation controller.

It does not seem to do anything so far... Am I missing something ?

like image 828
Pierre-Olivier Avatar asked Oct 30 '22 07:10

Pierre-Olivier


1 Answers

It turns out that I was calling these methods on my UINavigationController instead of my UIViewController.

It is now working properly if I do so.

like image 139
Pierre-Olivier Avatar answered Nov 15 '22 05:11

Pierre-Olivier