swift 3 how to open a popover so that it does not cover every viewcontroller that called it?

0

I already use the popover that opens through a "follow" and I wish I could set the dimensions (height and width) of this popover so it would not completely cover the viewcontroller that opened it. I use the following statements in the viewcontroller:

performSegue(withIdentifier: "callDriverPopupSegue", sender: self)


override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
    if segue.identifier == "callDriverPopSegue" {
        let popOver = segue.destination as! CallDriverPopup
        popOver.modalPresentationStyle = .popover
        popOver.popoverPresentationController!.delegate = self
    }
}

And in the popover I included the UIPopoverPresentationControllerDelegate:

class CallDriverPopup: UIViewController, UIPopoverPresentationControllerDelegate 
    
asked by anonymous 07.11.2016 / 19:46

1 answer

0

See here for an explanation of Apple in English however great

Here's an example of how to set size.

> let height = yourDataArray.count *
> Int(popOverViewController.tableView.rowHeight)
> popOverViewController.preferredContentSize = CGSize(width: 300,
> height: height)
    
09.11.2016 / 20:30