i am trying to show popover in ios8 using swift as
@IBAction func showPopUP(sender: AnyObject) {
let storyboard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
let popVC = storyboard.instantiateViewControllerWithIdentifier("pop")as! PopViewController
popVC.modalPresentationStyle = UIModalPresentationStyle.Popover
self.presentViewController(popVC, animated: true, completion: nil)
var presentationController = UIPopoverPresentationController()
presentationController.permittedArrowDirections = UIPopoverArrowDirection.Left | UIPopoverArrowDirection.Right
presentationController.sourceView = popVC.view
presentationController.sourceRect = popVC.view.frame
}
}
However gives me an error as
Terminating app due to uncaught exception 'NSGenericException', reason: '-[UIPopoverController init] is not a valid initializer. You must call -[UIPopoverController initWithContentViewController:].'
What am i doing wrong here?
EDIT: i want to show popover as of the default of ios 8

Here is the link of project on GoogleDrive : https://drive.google.com/open?id=0B6dTvD1JbkgBM3F6RXhjVGFvZmM&authuser=0