我正在使用 UIPopoverPresentationControllerDelegate 来显示我的弹出框,它工作正常,但无法管理弹出框 viewController 的宽度和高度。以及如何在当前上下文中设置演示文稿?
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let showObjectVC = storyboard?.instantiateViewController(withIdentifier: "ShowActorDetail") as! ShowActorDetailsViewController
showObjectVC.modalPresentationStyle = .popover
showObjectVC.popoverPresentationController?.sourceView = tableView.cellForRow(at: indexPath)
showObjectVC.popoverPresentationController?.delegate = self
showObjectVC.preferredContentSize = CGSize(width: 400, height: 300)
present(showObjectVC, animated: true, completion: nil)
}