PopOverViewController in iOS swift
Solution:
let popController = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "popOver") as! PopOverViewController
popController.delegate = self
// set the presentation style
popController.modalPresentationStyle = UIModalPresentationStyle.popover
// set up the popover presentation controller
popController.popoverPresentationController?.permittedArrowDirections = UIPopoverArrowDirection.up
if let presentation = popController.popoverPresentationController {
presentation.barButtonItem = navigationItem.rightBarButtonItem
}
popController.popoverPresentationController?.delegate = self
// present the popover
self.present(popController, animated: true, completion: nil)
Comments
Post a Comment