Support custom working-range logic.

This commit is contained in:
Huy Nguyen
2014-11-25 12:28:15 +02:00
parent 8e2a207373
commit 230520fe7e
4 changed files with 46 additions and 10 deletions

View File

@@ -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