Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Swift 从CollectionViewCell重新加载TableView_Swift_Uitableview_Uicollectionview_Uicollectionviewcell_Reloaddata - Fatal编程技术网

Swift 从CollectionViewCell重新加载TableView

Swift 从CollectionViewCell重新加载TableView,swift,uitableview,uicollectionview,uicollectionviewcell,reloaddata,Swift,Uitableview,Uicollectionview,Uicollectionviewcell,Reloaddata,有人知道如何重新加载CollectionViewCustomCell中的TableView吗?我有一个IBOutlet的表,访问该表的唯一方法是在cellForItemAtIndexPath方法中,我可以通过该方法访问我的CollectionViewCustomCell访问表 cell.tableViewInsideOfCollectionViewCell.reloadData() 但这只适用于第一次加载,当我更改CollectionViewsource时,它将不会重新加载TableView

有人知道如何重新加载
CollectionViewCustomCell中的TableView吗?
我有一个
IBOutlet
,访问该
的唯一方法是在
cellForItemAtIndexPath
方法中,我可以通过该方法访问我的
CollectionViewCustomCell
访问

cell.tableViewInsideOfCollectionViewCell.reloadData()
但这只适用于第一次加载,当我更改
CollectionView
source时,它将不会重新加载
TableView

如果您需要更多信息,请询问


提前谢谢

可以使用
collectionView.cellForItem(at:IndexPath)
方法获取单元格。然后将其强制转换为包含tableView的单元格类型。现在您可以访问该单元格属性并可以重新加载tableView

guard let cell = collectionView.cellForItem(at: IndexPath(row: , section: )) as? CustomCellWithTableView else { return }
cell.tableView.reloadData()

非常感谢@贾斯汀