reload cell data in table view with Swift

China☆狼群 提交于 2019-11-29 01:31:37

You can use self.tableView.reloadData() in order to reload your entire table or self.tableView.reloadRowsAtIndexPaths(paths, withRowAnimation: UITableViewRowAnimation.None) in order to reload a specific cell.

You can read more about the UITableView class here

Usman Nisar

To reload visible cells of tableview in Swift 3.0

pTableView.beginUpdates()

pTableView.reloadRows(at: pMessagesTableView.indexPathsForVisibleRows!, with: .none)

pTableView.endUpdates()
Mayank Jain

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()
}
Saurabh Prajapati

you can get Array of visible Cell by using TableView Function tableView.visibleRows() or You Can Get IndexPath of Visible Rows By tableView.indexPathsForVisibleRows() ! and then you can reload table by tableView.reloadData() Function!

look at following links

link1

you can read about UITableView Class Here

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!