I have an app that has a reusable XIB for a view that is included in every view controller of the app.
This XIB is responsible for rendering top-side views which are not navigation bar right now. A navigation item is not something that is needed right now.
However, based on contextual navigation, there maybe a need for user to be able to go back to previous view, and a Back button is a requirement for such cases.
I would like to make this Back button part of this reusable XIB which forms top-side view inside every scene - but only conditionally, not everywhere.
I read documentation, and other questions on SO that tells me that UIBarButtonItem only exist in conjunction with a nav-controller.
I think this is an overkill for me, because:
1) I don't need back button everywhere
2) I don't need the look of nav-bar as top bar. My top bar is already designed in my XIB.
What should I change?
- My XIB? If I can create outlets here for back button and make them hidden depending upon which view controller I am inside, it would be a highly welcome solution.
- My XIB view .m file?
- My view controller code where I want Back button?
An example with code will be highly appreciated.