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

前端 未结 6 1194
孤城傲影
孤城傲影 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

    I solved this using DispatchQueue.main.asyncAfter call popviewcontroller after the UIAlertController's Transition complete

    1) Show Alert

    2) Call pop viewcontroller after delay

    DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
        self.navigationController?.popToRootViewController(animated: true)
    }
    

    This is not best way, but it works!

提交回复
热议问题