Despotovic
Despotovic

Reputation: 1962

How to add UITableView section using interface builder

I have a storyboard with UITableViewController subclass in it. It looks like this:

UITableView sections in interface builder

I inherited this project, so I didn't make the section inside table view by myself. I can't find a way to add table view section (blue box on the image) other than copy/pasting the existing one and modifying later.

The object library doesn't seem tho have this component.

I know that I can manipulate sections in code, but my question is can this section (blue box on the image) be added using IB only?

Thanks!

Upvotes: 12

Views: 7236

Answers (2)

Usama
Usama

Reputation: 1965

For static tables, you can click on tableview in view hierarchy and then from property inspector you can mention number of sections for tableview. As shown in image.

enter image description here

Upvotes: 5

kabiroberai
kabiroberai

Reputation: 2913

Simply select your UITableView in the document outline and increment the sections like so:

Storyboard picture

Upvotes: 23

Related Questions