1

I am trying to do task after reloading tableview.

extension UITableView {
  func reloadData(completion:@escaping ()->()) {
      UIView.animate(withDuration: 0, animations: { self.reloadData() })
          { _ in completion() }
  }
}
 func updateTableView(completion: @escaping (Bool) -> Void) {
        tableView.reloadData {
            completion(true)
        }
    }

And in my class i am trying to do the stuff

 delegate?.updateTableView(completion: { [self] (updated) in
            if updated{

                isdropDownSelected1 = false
                isdropDownSelected2 = true
            }

        })

But i think it is not working. tableview reloading after my task.

Is there any other way to reload tableView?

Tapan Raut
  • 714
  • 2
  • 12
  • 1
    Does this answer your question? [How to tell when UITableView has completed ReloadData?](https://stackoverflow.com/questions/16071503/how-to-tell-when-uitableview-has-completed-reloaddata) – gcharita Oct 12 '20 at 23:02
  • Also https://stackoverflow.com/questions/43634046/ios-how-to-know-reloaddata-was-completed-its-task/59667837 – gcharita Oct 12 '20 at 23:03

0 Answers0