備忘録
ios13以降で画面遷移をPresent Modallyにした場合、dismissした時に遷移前の画面が更新されないので、対処法を残しておきます。
対処法1
PresentationをfullScreenにする
対処法2
extension 遷移前ViewControler: UIAdaptivePresentationControllerDelegate {
func presentationControllerDidDismiss(_ presentationController: UIPresentationController) {
tableView.reloadData()
}
}
extension 遷移後ViewController {
override func dismiss(animated flag: Bool, completion: (() -> Void)? = nil) {
super.dismiss(animated: flag, completion: completion)
guard let presentationController = presentationController else {
return
}
presentationController.delegate?.presentationControllerDidDismiss?(presentationController)
}
}
最後に
初心者のため、間違っている可能性があります。
参考までによろしくお願いします。