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

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

    Add the code of navigate controller on the ok action button handler. When Tap on ok button navigate the view controller

    let okActionBtn = UIAlertAction(title: "Ok", style: .default, handler: {
          self.navigationController?.popViewController(animated: true)
    })
    let cancelActionBtn = UIAlertAction(title: "Cancel", style: .cancel, handler: nil)
    let alert = UIAlertController(title: "Title", message: "Message", preferredStyle: .alert)
    alert.addAction(okActionBtn)
    alert.addAction(cancelActionBtn)
    self.present(alert, animated: true)
    

       

提交回复
热议问题