You could make a check when the row is selected:
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
if DayOfWeek() == indexPath.row{
cell.backgroundColor = UIColor.grayColor()
}
}
Or when you write the table you could:
func tableView(tableView: UITableView,cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell{
if DayOfWeek() == indexPath.row{
cell.backgroundColor = UIColor.grayColor()
}
}
Update
When the app is started you should in your viewDidLoad
check what day of the week it is and update the data, so that you always populate the main view when the app is started.
And then when a new cell is selected you can do the following:
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
// indexPath.row is the row that the user has selected
// use this value to update the data in your application
}