gpt4 book ai didi

swift - 从应用程序委托(delegate)打开子(非根) Controller

转载 作者:行者123 更新时间:2023-11-30 12:27:07 27 4
gpt4 key购买 nike

我正在尝试从具有以下结构的深层链接打开 View Controller :

# Regular navigation:
AppDelegate -> A (root) -> B -> C

# Deeplink navigation to a specific controller:
AppDelegate -> B (child of A)

我还想允许用户使用后退导航返回根 A(即使我必须在单击返回时创建它)

Controller A 是复杂位置监听器和 View 的混合体,因此我不想在打开 B 之前实例化它。

最佳答案

如果您在viewWillAppear()中添加位置监听器在 Controller A中,那么您可以实例化 Controller 而无需设置监听器。然后,您可以按[ControllerA(), ControllerB()]作为您的导航viewControllers并构建您的导航堆栈。

关于swift - 从应用程序委托(delegate)打开子(非根) Controller ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44049285/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com