![](/img/trans.png)
[英]How to reload selected cell in particular section for expand/collapse in tableview Swift
[英]reload selected cell of a tableview
因此,我有一個tableView,它首先呈現從一個json提取的數據,然后將獲取第二個由最后更新的參數組成的json。
不使用它,我只希望更新tableview中更新值大於1天的那些單元格。
重新加載數據的工作,但更新所有單元。
有什么方法可以根據json結果僅更新tableview的特定單元格嗎?
通過indexPath重新加載單元格的func: reloadRows(at:with :)
您可以通過以下方法在特定的Indexpath處使用reload UITableView
func reloadRows(at indexPaths: [IndexPath], with animation: UITableView.RowAnimation)
我建議您使用NSFetchedResultsController,在此處閱讀有關內容: https : //cocoacasts.com/populate-a-table-view-with-nsfetchedresultscontroller-and-swift-3
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.