0

enter image description hereHello i want to show multiple images in collectionView just like the above image. i can show two rows and three columns with the help of UICollectionViewDelegateFlowLayout, but unable to do that. help is much appreciated.

func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {        
        switch indexPath.item {
        case 0,1:
            return CGSize(width: (UIScreen.main.bounds.width - 4) / 2, height: (UIScreen.main.bounds.width - 4) / 2)
        default:
            return CGSize(width: (UIScreen.main.bounds.width - 6) / 3, height:  (UIScreen.main.bounds.width) / 3)
        }

    }
Kuldeep
  • 4,466
  • 8
  • 32
  • 59
Gorib Developer
  • 587
  • 2
  • 13
  • 27

0 Answers0