title: Detect if my controller is presented as popover
body: <p>Using Xcode 10.1 and Swift 4.2.1, iOS 12</p>
  
  <p>I got a tableview embedded in a navigation controller. In the upper right corner a bar button and a segue (popover) from this button to a navigation controller which holds a static table view, here the cells has further segues to other table views.</p>
  
  <p>On an iPhone the static table view is displayed as a full screen modal, on an iPad it's a popover, which is okay so far.
  I've set everything up in the storyboard, don't know if this could be the reason, but now I'm struggling to check if the view is a popover or a full screen modal.</p>
  
  <p>I've tried:</p>
  
  <pre><code>print("\(presentationController)")
  if presentationController is UIPopoverPresentationController {
      // Do something
  }
  </code></pre>
  
  <p>But this doesn't work -> <code>print("\(presentationController)")</code> gives me <code>Optional(&lt;_UIFullscreenPresentationController: 0x7fd00ad45770&gt;)</code> on iPhone and iPad.</p>
  
  <p>I've tried also with:</p>
  
  <pre><code>if popoverPresentationController != nil {
      print("popover")
  }
  </code></pre>
  
  <p>But popover is printed if launched on iPhone or iPad.</p>
  
  <p>Am I doing something wrong here or am I missing something?</p>