I am trying to reuse a specific view. Say it's a voting system with five buttons. Since it appears in different scenes/screen, I just wanted to have one view and reuse it where needed. So I create the view in a xib file named MyStarSystem.xib
. Now I want to simply drop my view into a storyboard view controller through the storyboard, not in code.
If all goes well, I know I should be able to do that by just dragging a UIView into the view controller and then set the class as UIVotingView
. But where do I tell UIVotingView
to draw the content of the xib? And of course, the buttons have to be interactive so I want to have IBOutlets and IBActions. So I was thinking of using -(void)drawRect:(CGRec)rect
but that makes no sense as a solution. Does anyone know how I might create this view once and use it all over -- by dropping it into the storyboard?