reloadData only on tableView visible cells

前端 未结 3 1824
无人共我
无人共我 2020-12-15 19:53

Is that possible? To reload only the cells that are visible in order to do it more efficient.

3条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-15 20:28

    To reload visible cells of tableview in Swift 3.0:

    guard let visibleRows = pTableView.indexPathsForVisibleRows else { return }
    
    pTableView.beginUpdates()
    
    pTableView.reloadRows(at: visibleRows, with: .none)
    
    pTableView.endUpdates()
    

提交回复
热议问题