Each cell contains the date and information(text). By default, sorting is in reverse order. It is sorted in the reverse order of the time. I want to change the background color of the cells in the cell prior to the current date.
tableView cellForRowAtIndexPath :
let cell = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexpath) as! tableViewCell
cell.dateLabel.text = stores.date
cell.contentLabel.text = stores.content
let today = NSDate()
if today == (stores.date) {
cell.backgroundColor = UIColor.blueColor()
} else {
cell.backgroundColor = UIColor.clearColor()
}
return cell