I have a tableview which on tap plays an audio and shows a progress view with start time and end time inside tableviewcell.Once the audio starts playing the values are updated in the didStartPlaying delegate function, where the function gets called continuously.
extension EpisodeTableViewCell: RadioPlayerDelegate {
func didStartPlaying(sliderValue: Float, labelValue: String, currentDuration:Float) {
DispatchQueue.main.async {
self.audioSlider.setProgress(sliderValue, animated: false)
print(currentDuration)
let minutes = Int((currentDuration.truncatingRemainder(dividingBy: 3600)) / 60)
let seconds = Int(currentDuration.truncatingRemainder(dividingBy: 60))
print("formated: \(minutes):\(seconds)")
self.startTime.text = "\(minutes):\(seconds)"
}
//audioSlider.layoutIfNeeded()
}
func didStopPlaying() {
playPauseImg.image = UIImage(named: "playBtn")
}
the same above code works in iOS app however for tvOS the cell UI does not update even when the function gets called.what am I doing wrong? I also tried putting the code in view controller and reloading the tableview cell,does not work.