使用故事板,我以模态方式呈现FirstViewController中的SecondViewController。然后,我从secondviewcontroller中以模态的方式展示第三视图控制器。我需要ThirdView控制器在选择
UITableViewCell
. 我通过使用以下代码实现了这一点。
let firstViewController = self.storyboard?.instantiateViewController(withIdentifier: "firstViewController") as! FirstViewController
self.present(firstViewController, animated: true, completion: nil)
然而,我刚刚意识到这可能不是最佳实践,因为这将在堆栈上添加另一个视图控制器。