I know that you can connect a custom view controller class to several different view controllers on a storyboard, but this can be done in a different direction; that is, depending on the situation, I want to associate different custom classes with one storyboard view controller, which will be created with:
[self.storyboard instantiateViewControllerWithIdentifier:]
background: I used to have several view controllers that are almost identical. In fact, the user classes to which they are attached are also very similar. To clear this up, I reorganized my custom classes into one base class and several subclasses. Then I removed all the similar view controllers from the storyboard, leaving only one that I limited to my base class. Then I call:
MySubclass* mySubclass = [self.storyboard instantiateViewControllerWithIdentifier:@"StoryboardControllerBoundToBaseClass"];
Unfortunately, my subclass code is ignored, and only the base class code is executed. Does anyone know how I can make it work without duplicating the view controllers on the storyboard and linking each of them to a different subclass?
source share