mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
Support for dynamic ranges
This refactors how we do ranges and implements tuning parameters for a "Render" range and a "Preload" range
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
|
||||
#import <AsyncDisplayKit/ASRangeController.h>
|
||||
#import <AsyncDisplayKit/ASCollectionViewProtocols.h>
|
||||
#import <AsyncDisplayKit/ASBaseDefines.h>
|
||||
|
||||
|
||||
@class ASCellNode;
|
||||
@@ -29,11 +30,24 @@
|
||||
@property (nonatomic, weak) id<ASCollectionViewDelegate> asyncDelegate;
|
||||
|
||||
/**
|
||||
* Tuning parameters for the working range.
|
||||
* Tuning parameters for a range.
|
||||
*
|
||||
* Defaults to a trailing buffer of one screenful and a leading buffer of two screenfuls.
|
||||
* @param range The range to get the tuning parameters for.
|
||||
*
|
||||
* @returns A tuning parameter value for the given range.
|
||||
*
|
||||
* Defaults to the render range having one sceenful both leading and trailing and the preload range having two
|
||||
* screenfuls in both directions.
|
||||
*/
|
||||
@property (nonatomic, assign) ASRangeTuningParameters rangeTuningParameters;
|
||||
- (ASRangeTuningParameters)tuningParametersForRange:(ASLayoutRange)range;
|
||||
|
||||
/**
|
||||
* Set the tuning parameters for a range.
|
||||
*
|
||||
* @param tuningParameters The tuning parameters to store for a range.
|
||||
* @param range The range to set the tuning parameters for.
|
||||
*/
|
||||
- (void)setTuningParameters:(ASRangeTuningParameters)tuningParameters forRange:(ASLayoutRange)range;
|
||||
|
||||
/**
|
||||
* Initializer.
|
||||
@@ -153,3 +167,9 @@
|
||||
- (void)collectionView:(ASCollectionView *)collectionView didEndDisplayingNodeForItemAtIndexPath:(NSIndexPath*)indexPath;
|
||||
|
||||
@end
|
||||
|
||||
@interface ASCollectionView (Deprecated)
|
||||
|
||||
@property (nonatomic, assign) ASRangeTuningParameters rangeTuningParameters ASDISPLAYNODE_DEPRECATED;
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user