Hello
I have a question about the checklist app.
So i made the variable row0checked = false.
row1checked = false
…
And use the ! to make it true when the row is tapped.
Now the variable row0checked = true right?
But then for the checkmark:
var isChecked = false
if indexPath.row == 0 {
isChecked = row0checked
} else if indexPath.row == 1 {
isChecked = row1checked
} else if indexPath.row == 2 {
isChecked = row2checked
} else if indexPath.row == 3 {
isChecked = row3checked
} else if indexPath.row == 4 {
isChecked = row4checked
}
if isChecked {
cell .accessoryType = .Checkmark
} else {
cell .accessoryType = .None
}
You make ischecked false with the var.
but the line: isChecked = row0checked. If the row0checked is selected so the value becomes true for that row right?
but does this line " isChecked = row0checked" make the variable for isChecked true when row0checked is true? ore do i have it rong ?