title: Warning: UICollectionViewFlowLayout has cached frame mismatch for index path 'abc'
body: <p>This is the code causing the warning:</p>
  
  <pre><code>private override func layoutAttributesForItemAtIndexPath(indexPath: NSIndexPath) -&gt; UICollectionViewLayoutAttributes? {
      let attributes = super.layoutAttributesForItemAtIndexPath(indexPath)
      let distance = CGRectGetMidX(attributes!.frame) - self.midX;
      var transform = CATransform3DIdentity;
      transform = CATransform3DTranslate(transform, -distance, 0, -self.width);
      attributes!.transform3D = CATransform3DIdentity;
      return attributes
  }
  </code></pre>
  
  <p>The console also prints:</p>
  
  <blockquote>
    <p>This is likely occurring because the flow layout "xyz" is modifying attributes returned by UICollectionViewFlowLayout without copying them.</p>
  </blockquote>
  
  <p>How do I fix this warning?</p>