I have selected Present as Popover
in Interface Builder for my StoryBoard Segue.
How can I get reference to UIPopoverController in prepareForSegue
?
I tried like this, but it not goes inside the if statement.
if segue is UIStoryboardPopoverSegue {
let popoverSegue = segue as UIStoryboardPopoverSegue
simpleTableViewController.popoverController = popoverSegue.popoverController
}
If you need popovercontroller, just to dismiss it, then the way to dismiss an adaptive view controller is:
self.dismissViewControllerAnimated(true, completion: nil)
You shouldn't check the type of the segue, rather you should check the segue identifier.
if segue.identifier == "popover" {
let popoverSegue = segue as UIStoryboardPopoverSegue
simpleTableViewController.popoverController = popoverSegue.popoverController
}