【发布时间】:2019-01-25 21:23:34
【问题描述】:
使用故事板,我以模态方式从 FirstViewController 呈现 SecondViewController。然后,我从 SecondViewController 模态地呈现 ThirdViewController。选择UITableViewCell 后,我需要 ThirdViewController 回到 FirstViewController。我通过使用以下代码实现了这一点。
let firstViewController = self.storyboard?.instantiateViewController(withIdentifier: "firstViewController") as! FirstViewController
self.present(firstViewController, animated: true, completion: nil)
但是,我现在才意识到这可能不是最佳实践,因为这会在堆栈上添加另一个 ViewController。
【问题讨论】:
标签: ios uiviewcontroller presentviewcontroller