I have a UINavigationController with 2 buttons (menu item). When I open segue and move to detail-view, the buttons disappear--just the back button appears.
I need to keep the menu item on the left:
I have a UINavigationController with 2 buttons (menu item). When I open segue and move to detail-view, the buttons disappear--just the back button appears.
I need to keep the menu item on the left:
That's a common behavior of UINavigationController as it relates to the view controller it just displays.
Never expect UINavigationBar have a meaning that e.g. web main menu has. Imagine it like that NavigationBar, NavigationItem with BarButtonItems behave always in relation to situation, i.e. actually displayed view.
The word navigation stands rather for ability to navigate somewhere from here, than to be some navigation tool for UI of your app.
The reason why you should leave the back button where it is: a user should know, that he is in detail view. And this is for Apple products philosophy very important - to be intuitive. That's why Apple devices have never had a hardware back button. This is the most used convention in apps, so if you want to access the main menu, you first need to get back from detail.
I would not suggest to break those practical rules.
I have UINavigationController with 2 buttons
No you don't. The buttons in a navigation controller's navigation bar belong to the current child view controller of that navigation controller. In particular, they belong to its navigationItem
.
So you have a view controller with two buttons.
And you have another view controller (the detail view controller) that doesn't have those two buttons.
So... If you want those buttons to appear in the detail view controller, give the detail view controller those buttons too!
An even better architecture would be to put the "permanent buttons" in the toolbar instead of the navigation bar. But you would still need to have these be toolbarItem
buttons of both view controllers.