Changing UITableView's section header/footer title without reloading the whole table view

前端 未结 10 630
轮回少年
轮回少年 2020-12-03 04:47

Is there any way to reload the section header/footer of a table view without calling [tableView reloadData];?

In fact, I want to show the number of cel

10条回答
  •  情歌与酒
    2020-12-03 05:02

    You can also do it this way

    override func tableView(_ tableView: UITableView, titleForFooterInSection section: Int) -> String? {
        switch section {
            case 0:
                return "Some string"
            default:
                return ""
        }
    }
    

提交回复
热议问题