所以我展示了一些 View Controller (从 xib 加载)
let popup = PopupViewController()
popup.configure(withDataSource: dataSource)
vc.present(popup, animated: false, completion: nil)
如您所见,我要求在没有动画的情况下呈现它。但是,呈现的 View Controller 中 viewWill\DidAppear
中的 animated
标志设置为 true
我是不是弄错了什么? 谢谢。
最佳答案
呈现 viewcontroller 是从一个 vc 到另一个 vc 的 vc 转换,viewWillAppear:animated 是将要显示的 View 动画。
根据 Apple 文档:
如果 View Controller 由弹出框内的 View Controller 呈现,则在呈现的 Controller 被关闭后,不会在呈现的 View Controller 上调用此方法。
关于ios - 为什么 `viewWillAppear` 将 `animated` 设置为 true,即使在呈现 `present(_, animated: false, _)` 时也是如此?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45861348/