swift3 - Cannot deselect previous programmatically selected row in tableview after another selection -
i using both in cellforrowat , exact in same function initialize tableview code:
cell.accessorytype = selectedoption == indexpath.row ? .checkmark : .none
and tableview got checkmark automatically selectedoption, when select option checkmark set earlier doesn't disapear , after there 2 checkmarks on table setted allowsmultipleselection false. why happening , why first checkmark doesn't hide after selection ?
func tableview(_ tableview: uitableview, didselectrowat indexpath: indexpath) { if let cell = tableview.cellforrow(at: indexpath) { cell.accessorytype = .checkmark } }
i think if reload tableview works, code fine, reload table in didselect,
thanks
Comments
Post a Comment