title: AutoSizing cells: cell width equal to the CollectionView
body: <p>I'm using AutoSizing cells with Autolayout and UICollectionView.</p>
  
  <p>I can specify constraints in code on cell initialization:</p>
  
  <pre><code>  func configureCell() {
      snp.makeConstraints { (make) in
        make.width.equalToSuperview()
      }
    }
  </code></pre>
  
  <p>However, the app crashes as the cell hasn't been yet added to the <code>collectionView</code>.</p>
  
  <p><strong>Questions</strong></p>
  
  <ol>
  <li><p>At which stage of the <code>cell</code>'s lifecycle it is possible to add a
  constraint with <code>cell</code>'s <code>width</code>?</p></li>
  <li><p>Is there any default way of making a <code>cell</code>'s<code></code>width<code>equal to the
  </code>width<code>of the</code>collectionView<code>without accessing an instance of
  </code>UIScreen<code>or</code>UIWindow`?</p></li>
  </ol>
  
  <p><strong>Edit</strong>
  The question is not duplicate, as it is not about how to use the AutoSizing cells feature, but at which stage of the cell lifecycle to apply constraints to achieve the desired result <strong>when</strong> working with AutoLayout.</p>