main thread swift

Swift
DispatchQueue.main.async {
    self.tableView.reloadData()
}
Source

Also in Swift: