Reputation: 430
I've noticed that in Storyboards, when dragging out a Table View object from the Library, you also get a chance to configure table view sections, and bunch of other options. For example, if the content is going to be static cells or dynamic prototypes, etc.
Here's a look at the Table View in Interface Builder (.storyboard file):
and here's how the Table View looks like in a .xib file:
So my question is - is it possible to configure/style (drag buttons, images, etc. into cells) a table view in a .xib file using Interface Builder or it can only be done programmatically?
Upvotes: 3
Views: 7306
Reputation: 14427
Can be done either way. I prefer doing it in IB as the layout is much easier when you can see what you are doing. For dynamic prototypes, you only design a single cell and the contents will be populated in the cellForRowAtIndexPath method. With a Static Cell tableview, you can design the whole thing (many sections and many rows). The requirement for a Static Cell tableview is that the class HAS to be of type UITableViewController, while for Dynamic Prototypes, it can be either a UITableViewController or (my preference for more flexibility) a UIViewController with a UITableView.
Hint - if this is a Static cell tableview and you only design a screen full of sections and rows, be sure to turn off scrolling for the tableview.
Upvotes: 0