this is the second time I posted here about this issue and no one could help me my project was good in iOS 14 and previous versions when I debug my app on simulator or real device that have iOS 15 the collectionView disappear while scrolling or until the collectionView disappear from seen , when the collectionViews disappear this show me in debugger
myPorjectiOS[21684:5460574] [Assert] UITableView internal inconsistency: cell prefetched for IP(3,0) already stored for IP(3,0). Cell: <myPorjectiOS.DashboardSectionTwoTableItem: 0x136307200; baseClass = UITableViewCell; frame = (0 149; 375 150); autoresize = W; layer = <CALayer: 0x28064e7c0>>; Prefetched Cells: {
"<NSIndexPath: 0xa51756da222d5115> {length = 2, path = 3 - 0}" = "<myPorjectiOS.DashboardSectionTwoTableItem: 0x136307200; baseClass = UITableViewCell; frame = (0 149; 375 150); autoresize = W; layer = <CALayer: 0x28064e7c0>>";
t] UITableView internal inconsistency: cell already prefetched for IP(3,0). Existing: <myPorjectiOS.DashboardSectionTwoTableItem: 0x136307200; baseClass = UITableViewCell; frame = (0 149; 375 150); autoresize = W; layer = <CALayer: 0x28064e7c0>>; New: <myPorjectiOS.DashboardSectionTwoTableItem: 0x136307200; baseClass = UITableViewCell; frame = (0 149; 375 150); autoresize = W; layer = <CALayer: 0x28064e7c0>>; Prefetched Cells: {
"<NSIndexPath: 0xa51756da222d5115> {length = 2, path = 3 - 0}" = "<myPorjectiOS.DashboardSectionTwoTableItem: 0x136307200; baseClass = UITableViewCell; frame = (0 149; 375 150); autoresize = W; layer = <CALayer: 0x28064e7c0>>";
and this show me only when running the app in iOS 15
cellForItemAt
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: R.reuseIdentifier.dashboardSectionTwoCollectionItem.identifier, for: indexPath) as? DashboardSectionTwoCollectionItem
let object = self.object[indexPath.row]
cell?.bind(object)
//fixing the hiding CollectionViews
return cell!
}
I tried to add self.collectionView.reloadData()
before return cell!
it fix my problem but the view was laggy and I can't tap on my content
this is my setupUI
func setupUI(){
self.collectionView.delegate = self
self.collectionView.dataSource = self
collectionView.register(UINib(resource: R.nib.dashboardSectionTwoCollectionItem), forCellWithReuseIdentifier: R.reuseIdentifier.dashboardSectionTwoCollectionItem.identifier)
}
func bind(_ object:[GenresModel.Datum]){
self.object = object
self.collectionView.reloadData()
}