How do I populate two sections in a tableview with two different arrays using swift?

后端 未结 5 1606
旧巷少年郎
旧巷少年郎 2020-12-04 10:09

I have two arrays Data1 and Data2 and I want to populate the data within each of these (they contain strings) into a tableview in two different sections.

The first s

5条回答
  •  时光说笑
    2020-12-04 10:24

    You can determine which section you are in by looking at indexPath.section. To specify the titles, override the function

    func tableView(tableView: UITableView!, titleForHeaderInSection section: Int) -> String!
    

提交回复
热议问题