IGListCollectionView
@interface IGListCollectionView : UICollectionView
This UICollectionView
subclass allows for partial layout invalidation using IGListCollectionViewLayout
.
Note
When updating a collection view (ex: calling-insertSections
), -invalidateLayoutWithContext
gets called on
the layout object. However, the invalidation context doesn’t provide details on which index paths are being modified,
which typically forces a full layout re-calculation. IGListCollectionView
gives IGListCollectionViewLayout
the
missing information to re-calculate only the modified layout attributes.
-
Create a new view with an
IGListcollectionViewLayout
class or subclass.Note
You can initialize a new view with a base layout by simply calling
-[IGListCollectionView initWithFrame:]
.Declaration
Objective-C
- (nonnull instancetype)initWithFrame:(CGRect)frame listCollectionViewLayout: (nonnull IGListCollectionViewLayout *)collectionViewLayout;
Swift
init(frame: CGRect, listCollectionViewLayout collectionViewLayout: IGListCollectionViewLayout)
Parameters
frame
The frame to initialize with.
collectionViewLayout
The layout to use with the collection view.