I have a UINavigationController with alot of viewControllers, and I want to add a UIBarButtonItem to the top-right. I did that, but I have to do this individually to each view controller. What’s the best pattern to add it once and have it stay there throughout the app?
I have a UINavigationController with alot of viewControllers , and I want to add
Share
Yes you can create a global function like in appDelegate and pass some parameters on that function. Like pass your navigationController,target,selector.
Here is sample code snippet.