mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
Support custom working-range logic.
This commit is contained in:
@@ -16,6 +16,13 @@ typedef struct {
|
||||
CGFloat leadingBufferScreenfuls;
|
||||
} ASRangeTuningParameters;
|
||||
|
||||
typedef NS_ENUM(NSInteger, ASScrollDirection) {
|
||||
ASScrollDirectionBackward,
|
||||
ASScrollDirectionForward,
|
||||
};
|
||||
|
||||
typedef NSRange (^asrangecontroller_working_range_calculation_block_t)(ASRangeTuningParameters params, ASScrollDirection scrollDirection, NSRange visibleRange, NSArray *nodeSizes, CGSize viewport);
|
||||
|
||||
@protocol ASRangeControllerDelegate;
|
||||
|
||||
|
||||
@@ -99,6 +106,13 @@ typedef struct {
|
||||
*/
|
||||
@property (nonatomic, assign) ASRangeTuningParameters tuningParameters;
|
||||
|
||||
/**
|
||||
* @abstract An optional block which can perform custom calculation for working range.
|
||||
*
|
||||
* @discussion Can be used to provide custom working range logic for custom layouts.
|
||||
*/
|
||||
@property (nonatomic, readwrite, copy) asrangecontroller_working_range_calculation_block_t workingRangeCalculationBlock;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user