Creating a reusable UIView with xib (and loading from storyboard)

Note that this QA (like many) is really just of historic interest.

Nowadays For years and years now in iOS everything’s just a container view. Full tutorial here

(Indeed Apple finally added Storyboard References, some time ago now, making it far easier.)

Here’s a typical storyboard with container views everywhere. Everything’s a container view. It’s just how you make apps.

enter image description here

(As a curiosity, KenC’s answer shows exactly how, it used to be done to load an xib to a kind of wrapper view, since you can’t really “assign to self”.)

Leave a Comment