For UICollectionViews
, is it possible to have multiple cell types?
For example:
media_cell
regular_cell
ad_cell
Would you just have to register them or do you have to include an if statement and change the layout according to some variable to achieve this effect.
For example:
if cell.ad == true {
}
The reason being, I want a slightly different sized cell for when an image is present. I guess resizing the cell could work but I haven't seen anything on this online.
Any suggestions
Two things and everything should be works:
Great tutorial
More info in this brilliant answer here
Good luck :)
Try this: 1. Register two(or more) cells. 2.Configure cellforItem for each. 3. Configure sizeForItem for each. First:
And then: