Marko Zadravec
Marko Zadravec

Reputation: 8738

UISplitViewController displayModeButtonItem in iPAD

I have trouble with the UISplitView on iPad.

I create normal application using UISplitView and in DetailViewController I add

override func viewDidLoad() {
    super.viewDidLoad()

    navigationItem.leftBarButtonItem = splitViewController?.displayModeButtonItem
    navigationItem.leftItemsSupplementBackButton = true
}

in iPhone it work fine

enter image description here

But in iPad it doesn't show button for stretching the detail view controller.

enter image description here

I know it can be done, because Apple has it in Note application.

How to accomplish this the right way?

Upvotes: 3

Views: 663

Answers (1)

Nublodeveloper
Nublodeveloper

Reputation: 1311

Set the SplitViewController's preferredDisplayMode to UISplitViewControllerDisplayModeAllVisible and it will appear.

But this will change it in portrait mode too on the iPad, and you probably don't want it there, so you'll have to check when rotating and change it accordingly.

Upvotes: 4

Related Questions