Nauman Aslam
Nauman Aslam

Reputation: 299

Swift: Table view section titles

Can any one explain the difference between these two section titles and that how can I achieve the default iOS section titles as in the setting image shown below. Thanks for the help. Im using the following function to set title and I expect this to be a default feature.

  override func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
        return "This is me title"
    }

This is the title I get on my sections. Here you can see title is bold black and no paddings.

While this is how it should look like.

Upvotes: 0

Views: 815

Answers (1)

Tj3n
Tj3n

Reputation: 9943

The same header as Settings can be achieved by using tableView's Grouped style

Upvotes: 1

Related Questions