Swift 3 - UISplitViewController - Hide/Expand Master View in Landscape (e.g. Notes App)
<p>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.</p>

<p>i.e.</p>

<p><a href="https://i.stack.imgur.com/MfJ2t.png" rel="noreferrer"><img src="https://i.stack.imgur.com/MfJ2t.png" alt="Expand Button in Notes App"></a></p>

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

<pre><code>splitViewController.preferredDisplayMode = .primaryOverlay
</code></pre>

<p>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).</p>

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

<p>Any help would be greatly appreciated! Thanks</p>