Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/design-patterns/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 跳过UINavigationController堆栈中的视图控制器_Ios_Design Patterns_Uiviewcontroller - Fatal编程技术网

Ios 跳过UINavigationController堆栈中的视图控制器

Ios 跳过UINavigationController堆栈中的视图控制器,ios,design-patterns,uiviewcontroller,Ios,Design Patterns,Uiviewcontroller,跳过导航堆栈中的视图控制器是一种不好的做法吗 在我的示例中,我有一个UINavigationController(以模式呈现)和三个UIViewController(firstViewController、secondViewController和thirdViewController),大多数时候用户都会访问firstViewController,可能会点击一行,然后加载secondViewController等等,但是,如果在某些情况下,我希望立即加载第二个或第三个视图控制器,但仍然将第一个

跳过导航堆栈中的视图控制器是一种不好的做法吗

在我的示例中,我有一个UINavigationController(以模式呈现)和三个UIViewController(firstViewController、secondViewController和thirdViewController),大多数时候用户都会访问firstViewController,可能会点击一行,然后加载secondViewController等等,但是,如果在某些情况下,我希望立即加载第二个或第三个视图控制器,但仍然将第一个视图控制器保留在堆栈中,以便用户仍然可以返回到第一个视图控制器,该怎么办


我可以这样做,但感觉不对——这是我应该避免做的事情吗?

是的,这叫做深度链接,非常好。对于来自外部URL或推送通知之类的事情,通常都会这样做