I have ViewControllerwith TableViewin it, now the data for is TableViewpulled through an HTTP call asynchronously in another class.
class ViewController1: UIViewController, UITableViewDelegate, UITableViewDataSource {
override func viewDidLoad() {
super.viewDidLoad()
self.tableView.registerClass(UITableViewCell.self, forCellReuseIdentifier: "cell")
MyHttpClass().getData()
...
}
MyHttpClassgets the data in a few seconds asynchronously, but it doesn’t have a link ViewControllerto transmit data (ideally, ViewController.tableView.reloadData is what I need to call)
Is there a better way to handle this? How do I get a link. to the ViewControllerinstance when it MyHttpreceives the data? Any better way to handle this?
source
share