简体   繁体   English

从TableViewCell跳转到NavigationController中嵌入的ViewController

[英]Jump from a TableViewCell to a ViewController embedded in a NavigationController

I am a newbie in iOS development and I am creating an application that has a sidebar, and from this sidebar the user can select a View to jump to. 我是iOS开发的新手,正在创建一个具有侧边栏的应用程序,用户可以从侧边栏中选择要跳转到的视图。 The views that are offered are part of a navigation controller. 提供的视图是导航控制器的一部分。 The NavigationController is the front of a revealViewController, so the sidebar will appear in every window linked to the NavigationController. NavigationController是reveveViewController的前面,因此侧栏将出现在链接到NavigationController的每个窗口中。

Bellow you can see my storyboard. 在下面您可以看到我的情节提要。

主故事板 The problem is, if I click the Map("Mapa") item from the menu(sidebar) I will have to move to the second View from the navigationController. 问题是,如果我从菜单(侧栏)单击Map(“ Mapa”)项,则必须从navigationController移至第二个View。 If I use a regular segue the navigation properties will disappear. 如果我使用常规搜索,导航属性将消失。 Is there a way to move to any of the views and maintain the navigation hierarchy? 是否可以移动到任何视图并维护导航层次结构?

Thanks in advance, 提前致谢,

Caio Guedes Caio Guedes

If I understand you correctly you want to have a sidebar in every view and just switch between them. 如果我对您的理解正确,则希望在每个视图中都有一个侧边栏,并在它们之间进行切换。 Since you want the views to be separate I would consider using Tab Bar because it is the default option in iOS to navigate between different views and is recommended by Apple. 因为您希望视图是分开的,所以我考虑使用“标签栏”,因为它是iOS中在不同视图之间导航的默认选项,并且由Apple建议。 But if you want to use sidebar anyways I would recommend using different navigation controller for each view controller. 但是,如果仍然要使用侧边栏,我建议为每个视图控制器使用不同的导航控制器。 Using one navigation controller would cause too much trouble. 使用一个导航控制器会造成太多麻烦。 Check out this tutorial that I managed to find. 查看我设法找到的本教程。 http://www.appcoda.com/sidebar-menu-swift/ Hope I could help just a little and sorry if I mislead you in any way, I'm a newbie as well! http://www.appcoda.com/sidebar-menu-swift/希望我能有所帮助,如果以任何方式误导您,对不起,我也是新手!

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何从自定义TableViewCell访问ViewController的navigationController - How to access a ViewController's navigationController from a custom TableViewCell 从嵌入在TabBarController和NavigationController中的ViewController推送新的ViewController - Pushing a new ViewController from a ViewController that is embedded in a TabBarController and NavigationController 如何从ViewController选择(推送)到NavigationController中嵌入的另一个ViewController? - How to segue (push) from ViewController to another ViewController embedded in NavigationController? 无法使用segue从tableViewCell跳到另一个viewController - Not able to jump from tableViewCell to another viewController using segue 如何从嵌入在TabController中的NavigationController内的ViewController访问tabBarItem? - How to access tabBarItem from ViewController inside of NavigationController embedded in TabController? 从RootViewController跳转到NavigationController - Jump to NavigationController from RootViewController 如何将值传递给嵌入在 NavigationController 中的 viewController - How to pass value to a viewController embedded in NavigationController 从堆栈的ViewController中的NavigationController的prepareForSegue - prepareForSegue for NavigationController in ViewController from stack 从 TableViewCell 中的 action 访问 ViewController - Access ViewController from action in TableViewCell 将数据从ViewController传递到tableviewCell - Passing data from a viewcontroller into tableviewCell
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM