Tru*_*an1 3 uitabbarcontroller uiviewcontroller uinavigationcontroller ios swift
我正在为我的应用程序实现深度链接,但无法正确实例化我的应用程序。对于我的应用程序链接,它打开了博客文章的详细信息页面,所以我像这样实例化它:
var controller = PostDetailController()
Run Code Online (Sandbox Code Playgroud)
问题是底部没有导航标题或选项卡栏。如何从头开始正确启动我的应用程序然后加载我的应用程序PostDetailController?
下面是我的故事板的样子,我试图直接链接到我的“Post Detail Controller”,但后面有所有以前的控制器,我该怎么做?

您可以通过多种不同的方式来实现这一点。假设您从应用程序委托的方法开始openURL:,下面是一种方法的高级视图。
openURL:方法中,解析出所需的参数url并将其存储在全局变量中。UITabBarController并创建一个函数来处理深层链接。此函数应评估应用程序委托中设置的全局变量并确定需要显示哪个选项卡和视图。例如:
// Check for deep link global var
if (myGlobalVar==1){
//Instantiate the destination view (the view you want the deep link to show)
DetailViewController *detailViewController = [storyboard instantiateViewControllerWithIdentifier:@"myDetailView"];
//set any vars need in the destination view
//Push the detail View to stack of the to be seleceted Tab
[[self.viewControllers objectAtIndex:myTABINDEX] pushViewController:detailViewController animated:NO];
//select the tab to the destination view
[self setSelectedIndex:myTABINDEX];
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1437 次 |
| 最近记录: |