Countdown timer in every table cell I am making countdown app with multiple records, so I am using UITableView to show that records and countdown dates. What I do is just take one timer and reload cells on every second. Is this a best approach to reload visible cells on every second or is there another better approach there?

updateCellContentsTimer = Timer.scheduledTimer(timeInterval: 1,
            target: self,
          selector: #selector(ViewController.updateCells),
          userInfo: nil, repeats: true)



// MARK: Custom Functions

func updateCells() {
    let indexPathsArray = tableView.indexPathsForVisibleRows
    for indexPath in indexPathsArray! {
        let cell = tableView.cellForRow(at: indexPath) as! CountdownTableViewCell

        cell.timeLeftLabel.text = progress + "hours:minutes:seconds"
    }
}
to avoid DRY i would put this line (i think it is in your code only a sample logic) inside the cell. in this case you have the logic for calculating the remaining time inside the cell and not outside somewhere. and you can use always the same function to update the progress.

cell.timeLeftLabel.text = progress + "hours:minutes:seconds"


should be become

cell.updateProgress()