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

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -