我有一个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
}
我该如何填写此功能?
你有一系列的部分标题
let headerTitle = sectionTitles[section]
或者您可以在favouriteCell中添加sectionTitles变量
headerCell?.name.text = favoritecells.sectionTitles[section]