Task is simple:
- We have a XIB.
- We have a custom UIView class implementation. Without XIB.
- We can add thanks to IB UIView element to the XIB and set its class to custom UIView class.
- We can create an outlet of our custom UIView class and connect custom UIView from XIB to it.
- But it seems that we should do additional steps to show our custom UIView (and its elements -- labels, images, etc) when XIB is loaded.
- Which steps?
UPD: The task is completed. We should use initWithCoder. Cite from Pizzaiola Gorgonzola: «initWithFrame is called when a UIView is created dynamically, from code. a view that is loaded from a .nib file is always instantiated using initWithCoder, the coder takes care of reading the settings from the .nib file». Thanks to question Subviews not showing up in UIView class.