Answers for "remove checkmark when selecting the cell again swift 5"

1

remove checkmark when selecting the cell again swift 5

override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
        if let cell = tableView.cellForRow(at: indexPath as IndexPath) {
            if cell.accessoryType == .checkmark {
                cell.accessoryType = .none
            } else {
                cell.accessoryType = .checkmark
            }
        }
        tableView.deselectRow(at: indexPath, animated: true)
    }
Posted by: Guest on May-24-2021

Code answers related to "remove checkmark when selecting the cell again swift 5"

Code answers related to "Swift"

Browse Popular Code Answers by Language