dismissViewControllerAnimated is called but ViewController is not dismissed

前端 未结 5 1645
旧巷少年郎
旧巷少年郎 2021-02-02 06:02

I am having a problems with the dismissViewControllerAnimated method not closing down the view.

What is happening in the app here is:

  • Cell in
5条回答
  •  离开以前
    2021-02-02 06:47

    Your Situation is - ItemViewController -> ItemDetailViewController (pushed on navigationController) Self.dismissViewController(..) dismiss a view controller that is presented over self(in ur case it is ItemViewController). Here, u did not presented any VC over self, instead u pushed a new VC over navigation stack. So, Correct way to dismiss ItemDetailViewController would be

    self.navigationController.popViewController(true). please read the description of dismissViewController(....) to get more clarity.

提交回复
热议问题