草庐IT

didShowViewController

全部标签

ios - didShowViewController 在 vi​​ewDidAppear 之后没有被调用

我在自定义导航Controller子类上使用UINavigationController委托(delegate)方法来提供特殊的UI行为。不幸的是,在某些情况下,我在推送View后没有收到didShowViewController回调,即使该View变得可见。我收到了一些委托(delegate)调用,大多数情况下一切正常-只有在我的应用程序中使用特定的ViewController时,我才会看到这种行为。 最佳答案 因此,在创建了一些测试之后,我发现问题可能是由didAppear或willAppear方法中呈现另一个ViewContr

ios - UINavigationControllerDelegate 的 didShowViewController 方法被调用了两次

classViewController:UIViewController,UINavigationControllerDelegate{overridefuncviewDidLoad(){super.viewDidLoad()navigationController!.delegate=self}funcnavigationController(navigationController:UINavigationController,didShowViewControllerviewController:UIViewController,animated:Bool){print("sho