“Application tried to present modally an active controller”?

后端 未结 8 1346
孤城傲影
孤城傲影 2020-11-29 02:20

I just came across a crash showing a NSInvalidArgumentException with this message on an app which wasn\'t doing this before.

Application

8条回答
  •  温柔的废话
    2020-11-29 02:59

    Instead of using:

    self.present(viewControllerToPresent: UIViewController, animated: Bool, completion: (() -> Void)?)
    

    you can use:

    self.navigationController?.pushViewController(viewController: UIViewController, animated: Bool)
    

提交回复
热议问题