mirror of
https://github.com/danog/Telegram.git
synced 2024-12-02 09:27:55 +01:00
52 lines
1.2 KiB
Objective-C
52 lines
1.2 KiB
Objective-C
#import "TGModernMediaListLayout.h"
|
|
|
|
@interface TGModernMediaListLayout ()
|
|
{
|
|
bool _updatingCollectionItems;
|
|
}
|
|
|
|
@end
|
|
|
|
@implementation TGModernMediaListLayout
|
|
|
|
- (instancetype)init
|
|
{
|
|
self = [super init];
|
|
if (self != nil)
|
|
{
|
|
}
|
|
return self;
|
|
}
|
|
|
|
/*- (void)prepareForCollectionViewUpdates:(NSArray *)updateItems
|
|
{
|
|
_updatingCollectionItems = true;
|
|
|
|
[super prepareForCollectionViewUpdates:updateItems];
|
|
}
|
|
|
|
- (void)finalizeCollectionViewUpdates
|
|
{
|
|
_updatingCollectionItems = false;
|
|
|
|
[super finalizeCollectionViewUpdates];
|
|
}*/
|
|
|
|
- (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
|