title: How to show UISplitViewController Master programmatically?
body: <p>I try to show the master of the SVC programmatically.</p>
  
  <p>The app is universal. I have a TVC on the master and another TVC on the details. The cells on the detail-TVC can be deleted by the user. After the user deleted the last cell in the detail-TVC on iPhone (compact) the master should be shown. On iPad (regular) the next existing cell on the master-TVC is selected and shown (works fine!)</p>
  
  <p>I tried to perform the <code>displayModeButtonItem</code>'s action manually but nothing happens:</p>
  
  <pre><code>extension UISplitViewController {
      func toggleMasterView() {
          let barButtonItem = self.displayModeButtonItem()
          UIApplication.sharedApplication().sendAction(barButtonItem.action, to: barButtonItem.target, from: nil, forEvent: nil)
      }
  }
  </code></pre>
  
  <p>For testing a added a "Show" button on the navigation-bar of the detail-TVC and performed the function above.</p>
  
  <pre><code>@IBAction func do_ShowMaster(sender: BaseUIBarButtonItem) {
  
      self.navigationController!.splitViewController?.toggleMasterView()
  
  }
  </code></pre>
  
  <p>Storyboard:
  <a href="https://i.stack.imgur.com/74zxB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/74zxB.png" alt="Storyboard"></a>
  Thank you in advance.</p>