title: collectionView:layout:sizeForItemAt not called swift 4 iOS 11
body: <pre><code>class HomeController: UICollectionViewController, UICollectionViewDelegateFlowLayout {
  
      private let cellId = "cellId"
  
      override func viewDidLoad() {
          super.viewDidLoad()
  
          collectionView?.register(Cell.self, forCellWithReuseIdentifier: cellId)
          collectionView?.backgroundColor = UIColor.red
      }
  
      override func numberOfSections(in collectionView: UICollectionView) -&gt; Int {
          return 1
      }
  
      override func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -&gt; Int {
          return 3
      }
  
      override func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -&gt; UICollectionViewCell {
          let cell = collectionView.dequeueReusableCell(withReuseIdentifier: cellId, for: indexPath) as! Cell
          return cell
      }
  
      func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -&gt; CGSize {
          return CGSize(width: 150, height: 150)
      }
  }
  
  class Cell: UICollectionViewCell {
      override init(frame: CGRect) {
          super.init(frame: frame)
  
          setup()
      }
  
      required init?(coder aDecoder: NSCoder) {
          fatalError("init(coder:) has not been implemented")
      }
  
      func setup() {
          backgroundColor = UIColor.black
      }
  }
  </code></pre>
  
  <p><code>numberOfSections</code> and <code>numberOfItemsInSection</code> are called (according to breakpoint), but <code>cellForItemAt</code> and <code>sizeForItemAt</code> are never called.</p>
  
  <p>I don't see anything wrong?</p>
  
  <p>UPDATE: (How I create HomeController in AppDelegate)</p>
  
  <pre><code>func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -&gt; Bool {
  
      window = UIWindow(frame: UIScreen.main.bounds)
      window?.makeKeyAndVisible()
  
      let layout = UICollectionViewLayout()
      let homeController = HomeController(collectionViewLayout: layout)
      window?.rootViewController = UINavigationController(rootViewController: homeController)
  
      return true
  }
  </code></pre>