我正在从名为HomeController的视图控制器中呈现一个视图控制器,如下所示:
let viewController = self.storyboard?.instantiateViewController(withIdentifier: "LoginController") as! LoginController
let navigationController: UINavigationController = UINavigationController(rootViewController: viewController)
present(navigationController, animated: true, completion: nil)
在展示的视图控制器中,LoginController 在某个时刻被关闭(dismissed):self.dismiss(animated: true, completion: nil)
但是当它返回到HomeController时,它没有调用viewWillAppear方法。我真的需要在HomeController中检查条件,那么当LoginController解除视图时,我该如何调用viewWillAppear方法呢?