Reputation: 2777
I am trying to implement the JASidePanels
in my project using storyboard
. You can see my storyboard over here.
The problem is that I don't see the button in the navigationbar to reveal the leftpanel. In my RootViewController I've this in code.
-(void) awakeFromNib
{
[self setLeftPanel:[self.storyboard instantiateViewControllerWithIdentifier:@"leftViewController"]];
[self setCenterPanel:[self.storyboard instantiateViewControllerWithIdentifier:@"centerViewController"]];
[self setRightPanel:[self.storyboard instantiateViewControllerWithIdentifier:@"rightViewController"]];
self.shouldResizeLeftPanel = YES;
self.shouldResizeRightPanel = YES;
[self setRightFixedWidth:300.0f];
[self setLeftFixedWidth:300.0f];
}
I've followed the steps that they say on the github page.
Also when I try to embed the RootviewController
inside a navigationController
. It is showing the navigationBar but not the barbutton item
.
Any help on this ?
Upvotes: 3
Views: 1924
Reputation: 19
Well, I'm using swift 2.2 and I couldn't either see the navigation button.
I'm using storyboards; so I created:
So in MainViewController
, I set up my VC as follows:
self.leftPanel = self.storyboard?.instantiateViewControllerWithIdentifier("LeftMenuViewController") //for left menu and
self.centerPanel = UINavigationController.init(rootViewController: (self.storyboard?.instantiateViewControllerWithIdentifier("ProductsViewController"))!)
Adding UINavigationController.init
will solve the problem, and you will see the navigation button in the center panel.
Upvotes: 0
Reputation: 8207
Embed your center UIViewController in storyBoard into UINavigationController, for example:
Use that name to create center panel
[self setCenterPanel:[self.storyboard instantiateViewControllerWithIdentifier:@"myCenterController"]];
So you don't actually set viewController as centerPanel, but a navigation controller containing your viewController.
Upvotes: 9