【发布时间】:2018-02-13 01:30:52
【问题描述】:
我有一个自定义的 UIView 子类 (AccountInfoModal),它通过将其添加为子视图呈现在 ViewController 之上。 AccountInfoModal 有一个按钮,应该会导致另一个 ViewController 出现。
初始化其他ViewController 不是问题。介绍它是。
由于AccountInfoModal 不是ViewController 我不能使用.present(viewControllerToPresent...)。
如何从 UIView 中呈现另一个 ViewController。我想不通。
编辑: 我已经实施了这个建议:
let underlyingVC = UIApplication.shared.keyWindow?.rootViewController
underlyingVC?.performSegue(withIdentifier: "SEGSignInViewController", sender: nil)
但它会导致最后一行崩溃(无法在包中加载 NIB:...)。
【问题讨论】:
标签: ios swift model-view-controller uiview