1234567891011121314151617181920212223242526 |
- //
- // GifListCollectionViewFlowLayout.swift
- // LiveLikeGiphyChallenge
- //
- // Created by Ljupco Nastevski on 31.1.22.
- //
- import UIKit
- class GifListCollectionViewFlowLayout: UICollectionViewFlowLayout {
-
- override func prepare() {
-
- super.prepare()
- guard let collectionView = collectionView else { return }
-
- let availableWidth = collectionView.bounds.inset(by: collectionView.layoutMargins).width
- let cellWidth = (availableWidth / 2).rounded(.down)
-
- self.itemSize = CGSize(width: cellWidth, height: cellWidth)
- self.sectionInset = UIEdgeInsets(top: 0.0, left: 0.0, bottom: 0.0, right: 0.0)
- }
-
- }
|