I want to create my own UI library containing several reusable controls. One very simple one could be a LabeledView that will contain a UIView (most probably an UIImageView) and a UILabel below.
----------------
| outer UIView |
| ------------ |
| | | |
| | UIView | |
| | | |
| ------------ |
| | UILabel | |
| ------------ |
----------------
How can I implement this in Interface Builder and "inject" the inner UIView and UILabel when creating the outer UIView? I have the outer UIView as File's Owner and the inner UIView and the UILabel connected with IBOutlets to properties in my LabeledView. I am now imagining an init function like:
[[LabeledView alloc] initWithView:(UIView *)theView andLabel:(UILabel *)theLabel]
That method should load the View from the nib with its defined layout and insert theView and theLabel into it. This couldn't be to hard, no? I don't get it...