0

I face one issue of displaying data in the table view. It works fine when I scrolling down and back to the top. I have also table reload in the main queue but it's not working for me. I have referred following link but not getting any solution.
showing-first-time-only-when-scrolling-a-bit
Table view cells showing actual data only after scrolling once

I have also reloaded table viewdidapear and also when I got data from the API.

  DispatchQueue.main.async {
                        self.tblDashboard.refreshControl?.endRefreshing()
                        self.tblDashboard.reloadData()
  }

Please find the attached video for the understanding (click here for video) and please see the code files here.

Ilesh P
  • 3,940
  • 1
  • 24
  • 49

1 Answers1

0

Strange !!

 if let aTempArr = result["songs"] as? [[String : Any]] {
       //// parsing code here ......

      self.tblDashboard.reloadData() ///<---
 }
  DispatchQueue.main.async {
      self.tblDashboard.refreshControl?.endRefreshing()
      self.tblDashboard.reloadData()
 }

Also, I move the cell method's code into the cellForRowAt indexPath in Tableview controller.

Ilesh P
  • 3,940
  • 1
  • 24
  • 49