how to reload a collectionview that is inside a tableviewcell

前端 未结 4 1287
闹比i
闹比i 2020-12-19 10:25

I have a collectionView inside a tableViewCell

for example: \"example\" credit: How to use StoryBoard quick bui

4条回答
  •  无人及你
    2020-12-19 11:11

    Simplest Way

    for cell in tableView.visibleCells {
        (cell as? YourTableViewCell)?.collectionView.reloadData()
    }
    

    Or If you need to reload Specific UICollectionView

    if let cell = tableView.cellForRow(at: IndexPath(row: 0, section: 0)) as? YourTableViewCell {
       cell.collectionView.reloadData()
    }
    

提交回复
热议问题