UICollectionViewLayout methods never get called
<p>I am working with a <code>UICollectionView</code> and I am trying to use the <code>UICollectionViewLayout</code> methods to adjust the sizing of the cell however they are never being called. The methods are :</p>

<p><code>sizeForItemAtIndexPath</code>, <code>minimumInterimItemSpacingForSectionAtIndex</code>, and <code>minimumLineSpacingForSectionAtIndex</code> </p>

<p>these 3 methods are never being called and I'm not sure where/ how to call them from. below is my code in Swift 3</p>

<pre><code>import Foundation
import UIKit

class CollectionVC: UICollectionViewController {

    var Sections = [SectionService]()

    override func viewDidLoad() {
        createServiceSections()
    }

    func createServiceSections(){

        ServiceSections.append(ServiceSection(headerTitle: "1", items: 2, headerImage: UIImage(named: "Default"), stats: nil))
        ServiceSections.append(ServiceSection(headerTitle: "2", items: 3, headerImage: UIImage(named: "Default"), stats: nil))
        ServiceSections.append(ServiceSection(headerTitle: "3", items: 3, headerImage: UIImage(named: "Default"), stats: nil))
        ServiceSections.append(ServiceSection(headerTitle: "4", items: 5, headerImage: UIImage(named: "Default"), stats: nil))
    }

    override func numberOfSections(in collectionView: UICollectionView) -&gt; Int {
        return ServiceSections.count
    }


    override func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -&gt; Int {
        return ServiceSections[indexPath.section].items.count
    }

    override func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -&gt; UICollectionViewCell {

        let cell1 = collectionView.dequeueReusableCell(withReuseIdentifier: "servicecell", for: indexPath) as! ServicesCellView

        cell1.serviceLabel.text = "test"
        cell1.serviceImage.image = ServiceSections[indexPath.section].headerImage
        return cell1
    }

    func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAtIndexPath indexPath: NSIndexPath) -&gt; CGSize {

        print("size for item at indexPath")
        var cellSize: CGSize
        let collectionViewWidth = self.collectionView!.bounds.size.width
        cellSize = CGSize(width: (collectionViewWidth * 0.48), height: (collectionViewWidth * 0.48))
        return cellSize
    }

    func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumInterItemSpacingForSectionAtIndex section: Int) -&gt; CGFloat {
        print("min spacing section")
        return 1
    }

    func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumLineSpacingForSectionAtIndex section: Int) -&gt; CGFloat {
        print("min line spacing section")
        return 1
    }
}
</code></pre>