isBeingDismissed not set in viewWillDisappear:

前端 未结 5 1383
独厮守ぢ
独厮守ぢ 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 13:15

    If by some chance you came here trying to use isBeingDismissed on a non-modally presented view controller, you can always check the topViewController property of your navigationController, for instance:

    if navigationController?.topViewController != self {
        return
    }
    

提交回复
热议问题