isBeingDismissed not set in viewWillDisappear:

前端 未结 5 1403
独厮守ぢ
独厮守ぢ 2021-02-13 12:25

I have some code to clean up in my viewWillDisappear:, which I only want to use when the view is moving back to the parent view controller.

- (void)         


        
5条回答
  •  走了就别回头了
    2021-02-13 12:53

    Your issue is how you are dismissing your modal view. How is rootViewController being defined?

    When I call [self dismissModalViewControllerAnimated:YES] then [self isBeingDismissed] evaluates to true.

    When I call [parentViewController dismissModalViewControllerAnimated:YES] then [self isBeingDismissed] evaluates to true, whereby parentViewController is the UIViewController that presented the modal view (note: not a UINavigationController).

提交回复
热议问题