ios JASidePanels make the UINavigationController the centerViewController

夙愿已清 提交于 2019-12-25 01:53:50

问题


In my application I am using the JASidePanels libraries, everything is set and working using storyboards, but I would like to push from my center view to a detail view by clicking on a tableViewCell, and for that I am assuming I need a UINAvigationController, can I somehow make the centerViewController start from a UINavigationController?


回答1:


You have to put an storyboard identifier to the Navigation Controller that embeds the main view controller you want to have as the center panel; then, set the center panel to be initialized with it in your "base" view controller (the one you subclassed with JASidePanelController).

// Hamburger menu setup
-(void) awakeFromNib
{
    [self setLeftPanel:[self.storyboard instantiateViewControllerWithIdentifier:@"menuViewController"]];
    [self setCenterPanel:[self.storyboard instantiateViewControllerWithIdentifier:@"mainDashboardNavigationController"]];
}

Where "mainDashboardNavigationController" is the storyboard identifier set to the UINavigationController that embeds what you want to present as center panel.

Hope it helps you, see the screenshot in the link below for more details. Xcode Screenshot



来源:https://stackoverflow.com/questions/16634684/ios-jasidepanels-make-the-uinavigationcontroller-the-centerviewcontroller

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!