In a navigation controller app, assuming you’ve assigned a title to the root controller, the pushed view will have a back button with that title in the top left of its navigation bar. That is automatic. How can I execute code based on the click event of that back button?
In a navigation controller app, assuming you’ve assigned a title to the root controller,
Share
Implement UINavigationControllerDelegate
Edit:
example for a simple two level hierarchy, but can easily be updated to more)
Make your root view controller the
UINavigationControllerdelegate (e.g. inviewDidLoad) and then implement as follows: