Using Xcode 10.1 and Swift 4.2.1, iOS 12
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.
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.
I've tried:
print("\(presentationController)")
if presentationController is UIPopoverPresentationController {
// Do something
}
But this doesn't work -> print("\(presentationController)") gives me Optional(<_UIFullscreenPresentationController: 0x7fd00ad45770>) on iPhone and iPad.
I've tried also with:
if popoverPresentationController != nil {
print("popover")
}
But popover is printed if launched on iPhone or iPad.
Am I doing something wrong here or am I missing something?