I know how to add a button to each controller I push into the navigation controller stack.
But I need to have a settings button on the upper right of the navigation bar, at all times, regardless of which controller gets pushed or popped. The button should present a settings viewController modally.
To me, having each controller’s viewDidLoad include code for the button plus including the settings controller header seems like a hack.
Seems like I should be able to insert this button from the navigation controller itself, pointing to a selector in the navigation controller. And this method would then present the settingsController modally through whichever controller happens to be active in the stack at that point.
Any ideas on how to achieve this?
Ok this is what I did:
1 – subclass UINavigationController and include the header for my settings controller
2 – override
-pushViewController:aniamted:3 – add two methods: