#import "TGStickerAssociatedPanelCollectionLayout.h" @interface TGStickerAssociatedPanelCollectionLayout () { bool _updatingCollectionItems; } @end @implementation TGStickerAssociatedPanelCollectionLayout - (UICollectionViewLayoutAttributes *)initialLayoutAttributesForAppearingItemAtIndexPath:(NSIndexPath *)itemIndexPath { if (_updatingCollectionItems || itemIndexPath.section != 0) return [super initialLayoutAttributesForAppearingItemAtIndexPath:itemIndexPath]; return nil; } - (UICollectionViewLayoutAttributes *)finalLayoutAttributesForDisappearingItemAtIndexPath:(NSIndexPath *)itemIndexPath { if (_updatingCollectionItems || itemIndexPath.section != 0) return [super finalLayoutAttributesForDisappearingItemAtIndexPath:itemIndexPath]; return [self layoutAttributesForItemAtIndexPath:itemIndexPath]; } @end