Reputation: 2838
i'm kind of confused right now. I'd like to use a partial view (= a region of the whole view) in many of my views and moreover i'd like to do it via storyboard.
These partial views usually have functions (they have to pass some kind of input to the "main" view controller).
So my question is: how can i (if possible) properly reuse those partial views without having add them to the superview in my code (i'm aware that i'll probably have to set the "main" view controller as a delegate in the code)?
I thought it could maybe possible via container views.
Thanks in advance.
Upvotes: 1
Views: 1264
Reputation: 3777
You can put them in a UIContainer. and have a UIContainer class with the container's frame size etc., and then create a standard view class to load into that container. If you want to use storyboard, that has been the best solution for me.
Upvotes: 1