override func viewDidLoad() {
let space:CGFloat = 10.0
let dimensionwidth = (view.frame.size.width - (2 * space))
let dimensionheight = (view.frame.size.height - (2 * space))
flowLayout.minimumInteritemSpacing = space
flowLayout.minimumLineSpacing = space
flowLayout.itemSize = CGSize(width: dimensionwidth, height: dimensionheight)
}
override func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "CellMemeCollection", for: indexPath) as! CellMemeCollection
let Meme = self.memes[(indexPath as NSIndexPath).row]
// Set the name and image
cell.MemeImage?.image = Meme.memeImage
cell.MemeImage.sizeThatFits(flowLayout.itemSize)
return cell
}
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
// let height = view.frame.size.height
// let width = view.frame.size.width
return CGSize(width: 200, height:400)
}
I tried every thing that would make the photo looks bigger but nothing changing .. I played with the items size and I tried to call the function collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize but nothing is working , help please !