Home > Back-end >  Swift 5.5: UISlider disable/enable animation inside custom TableView cell not working
Swift 5.5: UISlider disable/enable animation inside custom TableView cell not working

Time:01-05

I have created a custom UITableviewCell implementation using a XIB file and have added a UISlider inside of it that I want to be disabled when the cells load the first time, and be enabled when I click a button from the table cell. I set the "isEnabled" property of the Slider to be True with the button action.

When the tableView loads up the first time, the slider is disabled as intended, then I click the button, the property isEnabled is set to True but the Slider does not change its appeareance, it still looks greyed out until i click on it.

I have seen suggestions to use reloadTable() but in my case this is not acceptable. Is there something else that I can use to "bring back to life" the UISlider? Some function that refreshes only the UISlider not the entire table?

CodePudding user response:

An alternative for reloading the whole tableView by calling reloadTable() would be just reloading the affected rows by using reloadRows(at:with:) (docs). Perhaps this is acceptable in your case?

  •  Tags:  
  • Related