iOS: popViewController unexpected behavior

后端 未结 7 1932
迷失自我
迷失自我 2020-12-02 16:52

I\'ve been searching the internet for a solution. There\'s nothing I could find. So: I\'m using a UINavigationController. I am pushing two UIViewControllers onto it. In the

7条回答
  •  情话喂你
    2020-12-02 17:22

    I came across a similar situation in my code and the message said:

    nested push animation can result in corrupted navigation bar

    Finishing up a navigation transition in an unexpected state. Navigation Bar subview tree >might get corrupted.

    My finding to this issue was that I was pushing 2 view controllers one after the other in quick succession and both were animated.

    In your case it seems that you might be popping multiple view controllers with animation one after the other.

    Hence, while one view is undergoing animation you should not start animation on another view.

    I also found that if I disabled animation on one view, the error message disappeared.

    In my case it was a problem with the flow logic as I did not intend to push 2 view controllers one after the other. One was being pushed within the switch case logic and another after its end.

    Hope this helps someone.

提交回复
热议问题