Lets say I have a UIViewController subclass called ViewControllerOne and another ViewControllerTwo.
I know the at one point that the class I need in another method is either one of these. Is it possible to pass the class in a method, then inside that method which its received at, declare a UIViewController with whichever subclass was passed?
I want to know if its possible without just doing something like, if this = this, declare view one, else declare view two.
Thanks.
Your method could be:
Or something to that effect.
Or you could create the controller where you know what the class is and pass it into the method:
And then if need be inside the method:
Hope that helps! 🙂