0

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.

radb
  • 1
  • 1
  • Is your iOS and tvOS codebase the same? It seems to me you might accidently be updating iOS UI with some other code rather that the code you provided. – Mr.SwiftOak Feb 17 '22 at 11:28
  • No I have created different projects for tvOS and iOS – radb Feb 18 '22 at 04:52

0 Answers0