I have an app which has a UINavigationController, which has a couple of UIViewControllers. Each ViewController has its own nib.
The two view controllers are 90% identical. So currently, there is a lot of code duplication. So I’m wondering is there a way I can share the code that deals with each nib?
In other words, a class that can be passed between the view controllers, that can manage all the interface elements?
You might consider using a single UIViewController class, since they are so similar. In the init method, just have it load the nib you need for that instance.
Another option would be for one of the UIViewController to extend the other.
Either way, less code is usually better.