While an existing transition or presentation is occurring; the navigation stack will not be updated

前端 未结 6 1201
孤城傲影
孤城傲影 2021-02-01 16:36

I have encountered this warning:

pushViewController:animated: called on while an existing transition or presentation is occurring; the navigation stack

6条回答
  •  悲哀的现实
    2021-02-01 16:46

    This warning indicates that you are trying use UINavigationController wrongly:

    pushViewController:animated: called on while an existing transition or presentation is occurring; the navigation stack will not be updated

    You mentioned in the comments that you are trying to pop the ViewController using

    navigationController?.popViewControllerAnimated(false)
    

    inside completion block of UIAlertController. Therefore, you are trying to unwind from the wrong view, UIAlertController is not part of the UINavigationController stack.

    Try and close the UIAlertController first, then pop the current ViewController. In other words, remove the pop from the completion block and put it inside the OK block. or use unwind segue before the alert.

    Another possibility, is that you have an unused or identical duplicate in storyboard. Hence, if the unwinding operation is triggered by storyboard button, select this button and check the connectivity inspector and removed unwanted connections.

    For example: the red x marked was unnecessary in my case.

提交回复
热议问题