This is what i have achieved till now in my UICollectionView
This is my UICollectionViewDelegate
function
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
if indexPath.item % 2 == 0{
return CGSize(width: collectionView.bounds.size.width, height: 97 * 1.5)
}else{
return CGSize(width: collectionView.bounds.size.width/2.0, height: 97)
}
}
What i am looking for is this pattern...
Or at least if indexPath.item % 2 == 0
then create one cell layout else
2 cells layout.
My scroll direction is only vertical
Plus this is the view i get when i remove the UICollectionViewDelegateFlowLayout
function.
2 cells in each row. This is what i need but with different widths for each row like the target layout.
This is my storyboard prototype cell