如何在UITableView中填充标题单元格

问题描述 投票:0回答:1

我有一个UITableView标头,我需要填充。我正在使用ViewForHeaderInSection数据源阵列是由我选择它们之后由Footer Section的单元格创建的(我选择了我想要“引脚到顶部”的最喜欢的单元格。

   override func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
    let headerCell = tableView.dequeueReusableCell(withIdentifier: "HeaderViewCell") as? HeaderTableViewCell
    headerCell?.name.text = favoritecells //how can I select the source?
    return headerCell
}

我该如何填写此功能?

ios swift uitableview header
1个回答
0
投票

你有一系列的部分标题

let headerTitle = sectionTitles[section]

或者您可以在favouriteCell中添加sectionTitles变量

headerCell?.name.text = favoritecells.sectionTitles[section]
© www.soinside.com 2019 - 2024. All rights reserved.