viewDidDisappear not called when use presentViewController

后端 未结 1 1793
鱼传尺愫
鱼传尺愫 2020-12-11 03:43

I have an UIViewController having this method:

- (void)viewWillDisappear:(BOOL)animated {
    [super viewWillDisappear:animated];
    NSLog(@\"         


        
相关标签:
1条回答
  • 2020-12-11 04:24

    That is the correct behavior. Here's an excerpt about viewWillDisappear: from the UIViewController API docs:

    This method is called in response to a view being removed from a view hierarchy. This method is called before the view is actually removed and before any animations are configured.

    Presenting a new view controller so that it hides the other view controller doesn't count as the view disappearing—only actually being removed from a view hierarchy does (e.g., with something like popViewControllerAnimated:).

    0 讨论(0)
提交回复
热议问题