在 iOS 13 中,关闭视图控制器时不会调用 viewWillAppear。作为一种解决方法,它提到了覆盖 UIAdaptivePresentationControllerDelegate 委托,但它对我不起作用。我究竟做错了什么?
func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if segue.identifier == "MyVC" {
let destination = segue.destination as! MyViewController
destination.presentationController?.delegate = self
}
}
接着,
func presentationControllerDidDismiss(_ presentationController: UIPresentationController) {
resumePipeline() //<--Does not get called
}