I'm new to iOS app development. I intend to create an iOS TabBar application:
To do so, I wanted to create a template for the header which is photo. I created a xib file
which contains a label and I would like to use this template in my firstView, secondView and thirdView with different values assigned to that label. Is it possible ?
Swift file for firstView:
Swift file for Header (xib):
You can create a custom view class backing your .xib template, expose the label
property of this class to InterfaceBuilder using IBInspectable
, and add individually configured instances of this view to your three main views. This way you can do everything (except the definition of the template view) in Interface Builder.
This problem covers large parts of Xcode and IB, so here are some related tutorials you might find interesting (mainly using the #1 hits on Google):