Improvements for automatic range mode

- Only update range mode if visibility changes if the node is not range controlled
- Only change explicitly set range mode if ASRangeController becomes visible
- Return interface state for range controller in ASCollectionView and ASTableView based on if the containing node is range managed
This commit is contained in:
Michael Schneider
2016-03-15 13:38:46 -07:00
parent b30fa8b2f6
commit d3ba80ccfd
6 changed files with 59 additions and 25 deletions

View File

@@ -12,6 +12,18 @@
#import "ASCollectionNode.h"
#import "ASTableNode.h"
/**
* Update the range mode for a range controller to a specific range mode until the node that contains the range
* controller becomes visible again
*
* Logic for the automatic range mode:
* 1. If there are no visible node paths available nothing is to be done and no range update is done
* 2. The initial range update always will be ASLayoutRangeModeCount (ASLayoutRangeModeMinimum) as it's the initial fetch
* 3. If the range mode is explicitly set via updateCurrentRangeWithMode: it will last in that mode until the range controller becomes visible and a new range update was triggered or a new range mode via updateCurrentRangeWithMode: is set
* 4. If range mode is not explicitly set the range mode is variying based if the range controller is visible or not
*/
@protocol ASRangeControllerUpdateRangeProtocol <NSObject>