I had similar issue with iOS18.(issue exists in below code)
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: CustomCollectionViewCell.collectionTextCell.rawValue, for: indexPath) as? CollectionTextCell else {
return UICollectionViewCell()
}
cell.isDetailPage = isFromDetailPage
cell.manageFocus(isFocusSelected: isSelectedFocus == indexPath.row)
switch detailComponentType[indexPath.row] {
case .episodes, .trailer, .morelikethis, .castcrew, .OtherChannelsLive, .recommendeLivechannelsforyou, .similarContentLive, .highlightsSports, .otherTournaments, .readMore, .playlist:
cell.manageData(data: detailComponentType[indexPath.row])
case .bestOfProvider: cell.textlbl.text = Constant.bestOfProvider + /content_Data?.where_to_watch?.first?.provider?.name
case .otherSportsType: cell.textlbl.text = Constant.otherSportsType + /content_Data?.format + " " + Constant.tournaments
}
return cell
}