reload cell data in table view with Swift

前端 未结 4 1350
不知归路
不知归路 2020-12-14 09:28

how is it possible to reload data for a cell in my table view? I want to do a request to my Server and the server responses JSON. At the moment I implemented the request and

4条回答
  •  不知归路
    2020-12-14 09:49

    Try this...

    Swift 2.0

    dispatch_async(dispatch_get_main_queue(), { () -> Void in
       self.tableView.reloadData()
    })
    

    Swift 3.0

    DispatchQueue.main.async {
        self.tableview.reloadData()
    }
    

提交回复
热议问题