I've created my toolBar and navigationBar and added the respective items to it. I'm still new to coding but its my understanding that UINavigationController only displays the navBar and toolBar for the viewController in the top of the seque. I'm doing this without storyboards and in swift.
Asked
Active
Viewed 87 times
-1
-
2What is the issue you are facing, your question provides very little information about your issue. – Paras Gorasiya Sep 18 '17 at 05:33
-
I'm lost as to where to begin. I've connected to view controllers to buttons on my toolbar and I want those to have the same navigation bar and toolbar bar with the buttons in them – Jonathan Pardo Sep 18 '17 at 12:08
-
You can check this out https://stackoverflow.com/a/9273559/2768604 – Paras Gorasiya Sep 18 '17 at 14:14
-
I'm not using storyboards, but unfortunately most of the documentation for help is with storyboards. I've seen a ton of videos and read every stackoverflow question and I'm still lost. – Jonathan Pardo Sep 18 '17 at 14:23
1 Answers
0
If you want to add more than one bar button items to UINavigationBar
programatically, you can do that like
UIBarButtonItem *btnShare = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAction target:self action:@selector(share)];
UIBarButtonItem *btnRefresh = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemRefresh target:self action:@selector(refresh)];
[self.navigationItem setRightBarButtonItems:[NSArray arrayWithObjects:btnShare, btnRefresh, nil]];
Hope this will help you.

Paras Gorasiya
- 1,295
- 2
- 13
- 33
-
thanks but i've already added the buttons to both bars. In my bottom bar i have two UIBarbutton items connected to two other view controllers. I cant seem to figure out how to pass the UINavigation bar with the same buttons and the UIToolBar with the same buttons over. Also if possible i code in swift but objective c is fine too – Jonathan Pardo Sep 18 '17 at 14:46