How do I set a custom image to all back buttons of view controllers pushed in a UINavigationController?
My issues are:
- must look like
leftBarButtonItem
, position-wise (because thebackBarButtonItem
itself is too glued to the left and I can't seem to change it's horizontal alignment). - has to be on all back actions (instead of manually setting on each view controller).
- having a method
setCustomBackButton
and calling it on each view controller is also not an option, I'm looking for something likeUINavigationBar.appearance()
, i.e., throughout the app.
Something like this:
But with the back action working without me manually setting the selector on each view controller.
UPDATE: In response to Joe's solution, I'm getting that error: