-1

I'm a quite new in Swift programming and I usually do as much view design as possible with storyboard. I want to make an application using the CosmicMind/Material framework which will have side menu and selecting any menu point will open a new View embedded in NavigationController.

The Storyboard examples only include very simple cases both for SideNavigationController and NavigationController. So based on this, App example in Programmatic folder and answers in Stackoverflow I create an example with 3 menu points and 3 views. It can be found under GitHub repository tag stackoverflow.

I think that side menu and pushing the views within NavigationController works well. Question is, if it is the best practice of how to use Material framework. But the problem is that it do not show the Menu icon and Title in NavigationItem for the Main Screen.

Can you help me what is wrong in my code?

Or maybe it will be good to have similar more complex example within Storyboard examples for SideMenu.

Thank you very much.

rkoncz
  • 11
  • 2
  • I am not sure why this was down voted. Currently, we are making examples that will better exemplify more complicated scenarios. I'll try to take a look at your code shortly. – CosmicMind Apr 21 '16 at 22:55
  • Thank you. I do not know why it was down voted too. For sure there are two or three similar questions, but this one is finally about the Navigation Item problem and let´s say request for more complex storyboard based example. Maybe next time need to add better title. – rkoncz Apr 22 '16 at 05:22
  • @CosmicMind had you time to take a look on my code? When these examples mentioned by you will be committed. Thanks a much for the help. – rkoncz Apr 28 '16 at 18:46
  • I will check tonight, sorry, for the delay. – CosmicMind Apr 28 '16 at 19:24
  • going to check this in a couple hours. Was held up last night. – CosmicMind Apr 29 '16 at 18:22
  • @CosmicMind I see lot of communication on Material GitHub oage, but do you now have any estimation when the new version with expanded examples will be released? Or at least check my code and give me any hints where is the problem. I see with the Debug View Hierarchy that the NavigationBarView is hide the Material Navigation Item. Thanks. – rkoncz May 03 '16 at 21:58

1 Answers1

1

I looked at the code and from what I gather, is that you are placing the navigationItem code in the wrong place. This is how the setup should be.

SideNavigationController.rootViewController -> MenuViewController. MenuViewController.rootViewController -> NavigationController NavigationController.rootViewController -> UIViewController. (Place navigationItem) within this UIViewController.

I don't do much with storyboards... actually no development at all with storyboards, so I didn't go through too much of the setup there. But the above is how you should be thinking.

You could reverse the relationship between the MenuViewController and NavigationController, where the

NavigationController.rootViewController -> MenuViewController MenuViewController.rootViewController -> UIViewController.

In this case, the MenuViewController is where you would put the navigationItem code, as it is the direct child (rootViewController) of the NavigationController.

I hope this helps you :)

CosmicMind
  • 1,499
  • 1
  • 10
  • 6