I am wondering how can I implement polymorphism in the iPhone XCode storyboard ViewControllers.
This is my problem: Two different ViewControllers in my application are segueing to a common ViewController.
This common ViewController is behaving differently depending on the VC it was segued from - different remote API server calls and CoreData fetches are performed (for the first it presents all users in a table, for another it presents a list of admins - subclass of users, and I may have a third one that will presents filtered list of users).
This common ViewController is very centric in my application, and segues to many other ViewControllers. Therefore, it does not seem right to me to duplicate it on the stroyboard with a subclass.
Passing the list of users to the ViewController is less of an option unfortunately, since different searches on this list are performed and implemented across the ViewController methods.
It makes sense to implement these different behaviours by subclassing and using polymorphism, and assigning the ViewController in the storyboard the subclass according to the origin segue.
Is there any way to set the Storyboard ViewController classes dynamically when segueing?