Closed hengchengfei closed 9 years ago
I can't reproduce your warning. Did you get the warning with the example project or your project? Which version of swift are you using? I updated my pod may be i solved it
XCode7.1 Swift2.1
it occurs in my project.
I appreciate.
in layoutAttributesForElementsInRect(rect: CGRect) replace this line var allItems = super.layoutAttributesForElementsInRect(rect)!
with this, removed the warning for me:
var allItems = [ UICollectionViewLayoutAttributes ]() let attributes = super.layoutAttributesForElementsInRect(adjustedRec) for originalAttribute in attributes! { allItems.append(originalAttribute.copy() as! UICollectionViewLayoutAttributes) }
Warning:
This is likely occurring because the flow layout subclass eval.IOStickyHeaderFlowLayout is modifying attributes returned by UICollectionViewFlowLayout without copying them
IOStickyHeaderFlowLayout.swift
[http://stackoverflow.com/questions/31771089/when-using-subclassed-collectionviewflowlayout-im-getting-weird-error]()