#import "TGAttachmentSheetRecentLayout.h" @interface TGAttachmentSheetRecentLayout () { bool _updatingCollectionItems; } @end @implementation TGAttachmentSheetRecentLayout - (instancetype)init { self = [super init]; if (self != nil) { } return self; } - (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