title: CollectionView AutoResize Label Not Working
body: <p>I have a vertical collectionview with label and in my flowlayout i am using <strong><code>UICollectionViewFlowLayoutAutomaticSize</code></strong> to resize the cell size  but it is giving me error when i give very long string to the label, number of line in <strong><code>label</code></strong> set to 0 </p>
  
  <p><strong>Error</strong></p>
  
  <blockquote>
    <p>Please check the values returned by the delegate.
     The relevant</p>
    
    <p>UICollectionViewFlowLayout instance is UICollectionViewFlowLayout ,and
    it is attached to UICollectionView; frame = (0 88; 375 690);
    clipsToBounds = YES; autoresize = RM+BM; gestureRecognizers = NSArray
    layer = CALayer; contentOffset: {0, 0}; contentSize: {375, 2};
    adjustedContentInset: {0, 0, 0, 0}> collection view layout:
    UICollectionViewFlowLayout</p>
    
    <p>Make a symbolic breakpoint at
    UICollectionViewFlowLayoutBreakForInvalidSizes to catch this in the
    debugger.</p>
    
    <p>The behavior of the UICollectionViewFlowLayout is not defined because
    the item width must be less than the width of the UICollectionView
    minus the section insets left and right values, minus the content
    insets left and right values</p>
  </blockquote>
  
  <p><strong>Constraints</strong></p>
  
  <p><a href="https://i.stack.imgur.com/uyk4i.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uyk4i.png" alt="enter image description here"></a></p>
  
  <p><strong>Code</strong></p>
  
  <pre><code>let array = ["Hello", Array(repeating: "Hello", count: 100).joined(), "blah"]
  // on viewDidLoad method
   if let flowLayout = collectionView.collectionViewLayout as? UICollectionViewFlowLayout {
          flowLayout.estimatedItemSize = CGSize(width: 1, height: 1)
          flowLayout.itemSize = UICollectionViewFlowLayoutAutomaticSize
      }
  </code></pre>