ios JASidePanels make the UINavigationController t

2019-08-30 07:40发布

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条回答
倾城 Initia
2楼-- · 2019-08-30 08:24

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

查看更多
登录 后发表回答