I\'m trying to fit my app to all screensize, however I can\'t figure out how to. Is it possible to resize the cell depending on the screen? At the moment I just configure my
Drag the collectionViewFlowLayout from the document outline in interface builder into your code to create an outlet. In ViewDidLayoutSubviews (this when you know your frame width) set the width and height:
//MARK: IBOutlet
@IBOutlet weak var collectionViewFlowLayout: UICollectionViewFlowLayout!
override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
let width = collectionView.frame.size.width - collectionViewFlowLayout.sectionInset.left - collectionViewFlowLayout.sectionInset.right
collectionViewFlowLayout.itemSize = CGSize(width: width, height: width)
}