Code: Select all
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath)
cell.textLabel?.text = options[stepIndex][indexPath.row]
cell.textLabel?.font = UIFont(name: "Inter-Regular", size: 18)
let iconImage = UIImage(named: optionIcons[stepIndex][indexPath.row])
if stepIndex == 0 {
cell.imageView?.sd_setImage(with: URL(string: optionIcons[stepIndex][indexPath.row]), placeholderImage: UIImage(named: "icon-history"))
} else {
cell.imageView?.image = iconImage
}
cell.imageView?.tintColor = .systemBlue
// Update checkbox state
if selectedOptions.contains(options[stepIndex][indexPath.row]) {
cell.accessoryType = .checkmark
} else {
cell.accessoryType = .none
}
return cell
}