11

Just started with Swift and would like to replicate some functionality present in the standard Apple 'Notes' app. Specifically the Expand button that appears in the Details View when on iPad in landscape mode.

i.e.

Expand Button in Notes App

The closest I have come (as a simple quick solution) is to add the following into AppDelegate:

splitViewController.preferredDisplayMode = .primaryOverlay

However although this allows for toggling the Master View in landscape orientation (similar to the default portrait behaviour), it is done with the Master View as a popover/overlay. I however would prefer the behaviour present in the Notes app in that the Master View slides in/out (without overlaying the Detail View).

Edit: also interested in how to only show the corresponding button only in Landscape mode while on iPad.

Any help would be greatly appreciated! Thanks

Dan Rosenstark
  • 64,546
  • 54
  • 267
  • 405
Paul Popiel
  • 802
  • 10
  • 20

1 Answers1

10
splitViewController.preferredDisplayMode = .allVisible

This should do the trick. It makes the Master View slide in and out when toggling to fullscreen mode.

Dan Rosenstark
  • 64,546
  • 54
  • 267
  • 405
Keiwan
  • 7,331
  • 5
  • 31
  • 48