Forum Xamarin Xamarin.iOS

Double tapping UITabBarController not calling ViewDidDisappear

ErnestJErnestJ AUMember ✭✭✭


I've noticed that if I push few UIViewController's and then double tap tabbar item in my main menu (which pops back to root screen by default) then only top view controller's ViewWillDisappear and ViewDidDisappear methods are called.

Any idea why those methods are not called for view controllers in between? I need to execute some code every time controllers disappears, but because it's not being called in this instance I can't do this. To fix this I can probably disable double tapping, but wonder why is this happening in first place?

Best Answer


  • adamkempadamkemp USInsider, Developer Group Leader mod

    ViewWill/DidDisappear is only called when the View is removed from the window, which can only happen if preceded by a (matched) ViewWill/DidAppear call (which is called when the View is added to the window). Since the intermediate view controllers are not in the window it doesn't make sense for them to receive that message.

    What are you trying to do that you need to happen?

  • ErnestJErnestJ AUMember ✭✭✭

    Thanks Adam. Is there any other event called in this case?

    I've some cleanup code which I call on ViewDidDisappear (only when moving back and not when other view is pushed on top).

Sign In or Register to comment.