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

Popular posts from this blog

Invalid bundle error while upload the app to the app Store

store cgpoint in userdefaults iOS swift