iosswiftuitableviewuitableviewrowactionuitableviewsectionheader

Reload header in section without reloading section rows in swift


I'm trying to reload UITableView section Header instead of reloading the whole section's rows because I have a UITextfield in the row and when I call tableview reloadSections it's clear the textfield value.


Solution

  • let sectionIndex = IndexSet(integer: 0)
    self.tableView.reloadSections(sectionIndex, with: .none)
    

    You can reload the tableview with this code. You dont need to reload header for showing items