Вы можете изменить if/else
на:
if [0, 5, 10, 14, 18].contains(indexPath.row) {
//timeCell
let cell = tableView.dequeueReusableCell(withIdentifier: "timeCell") as! FridayTableCell
cell.dateLabel.text = tableViewData[indexPath.row].time
return cell
} else {
// default
let cell = tableView.dequeueReusableCell(withIdentifier: "default") as! FridayTableCell
cell.dateLabel.text = tableViewData[indexPath.row].time
cell.nameLabel.text = tableViewData[indexPath.row].name
return cell
}
Или используйте switch
:
switch indexPath.row {
case 0, 5, 10, 14, 18:
//timeCell
default:
// default
}