[ad_1]
after updating from swift 4 to swift 5, my UICollectionView disappearing whereas scrolling (ONLY horizontal view ) as a result of within the gif file there’s one other UICollectionView nevertheless it’s vertical, I did not face this downside in swift 4, I searched stack overflow and I noticed a variety of reply nevertheless it did not helped me ,
this can be a gif. file present the proccess
that is my heightForRowAt perform
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
change indexPath.part {
case 0:
return UITableView.automaticDimension
case 1:
return 200
case 2:
return UITableView.automaticDimension
case 3:
if (self.topAlbumsArray.isEmpty){
return 300.0
}else{
return 120.0
}
default:
return 280
}
}
that is the collectionView perform
func collectionView(_ collectionView: UICollectionView, format collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
return CGSize(width: 150, peak: 200)
}
func collectionView(_ collectionView: UICollectionView, format collectionViewLayout: UICollectionViewLayout, minimumInteritemSpacingForSectionAt part: Int) -> CGFloat {
return 8
}
func collectionView(_ collectionView: UICollectionView, format collectionViewLayout: UICollectionViewLayout, minimumLineSpacingForSectionAt part: Int) -> CGFloat {
return 8
}
func collectionView(_ collectionView: UICollectionView, format collectionViewLayout: UICollectionViewLayout, insetForSectionAt part: Int) -> UIEdgeInsets {
return UIEdgeInsets(prime: 0, left: 10, backside: 0, proper: 0)
}
[ad_2]
