UICollectionViewLayoutAttributes Subclass
If you're using a custom subclass of UICollectionViewLayoutAttributes, you have to implement copyWithZone: to make sure your currently set values get copied over.
It seems that the UICollectionViewLayout may copy the attributes you pass back in layoutAttributesForElementsInRect: before applying them to the UICollectionViewCell.
Here's a sample project demonstrating the point, CollectionViewAttributesTest.
Written by Brian Michel
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Related Tags
#cocoa
#ios
#objective-c
#uicollectionview
#uicollectionviewlayout
#uicollectionviewlayoutattributes
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#