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?