I created a storyboard describing how my navigation-flow is supposed to work, and this works just the way its supposed to be.
at one point i use a collection view to display a list of different levels, where you can pick one.
Now i am using a segue to move ahead to the view controller which is supposed to handle the user input. It consist of 2 image views and 1 custom view i implemented.
But i have 2 different kinds of custom views which subclass an abstract version of the same class. They do similar stuff, most of the time but at some points they are different, so i thought i need to put the into separate classes.
With one class i can just let the Storyboard inflate/instantiate the superclass, since it wasn't supposed to be abstract at that point.
The idea is that i can pass along the level object, when preparing for segue, and the controller automatically binds the matching controller to the custom-view, which should work since i associated the abstract class with the view.
My Problem is, since the Storyboard handles the initialization of the ViewController, i don't know where or how to apply the Factory.
I've done something similar in Android, but im not entirely sure that this is the best or a good approach on iOS at all.
Besides i to just add the controller in code myself, but i am using auto-layout. and the first point at which i was able to figure out the dimensions of the current view and its chilviews is in ViewDidAppear. But if i start adding/resizing my custom view now, it looks shitty. If i add it in Storyboard, it has the proper size right from the beginning since i could attach constraints to it, just the way i did it with the ImageViews.
Id appreciate any help, or hint into the right direction.
EDIT
im fairly certain that MasterDetail like implementation would work, but from what i understand this isn't any different to the version in which i handle the view-controller creation myself. i want the view to get its size by auto-layout, so that when they appear for the first time, they already have the proper size and i don't have to resize them after already displaying them.
Which raises the Question, can i add a View in Storyboard without a ViewController, and just attach the ViewController to the view in code?
Is that a bad idea?