Update ASCellNode visibility API

This commit is contained in:
Huy Nguyen
2016-02-29 16:21:19 -08:00
parent 07ad27c7f6
commit c64f23725f
4 changed files with 42 additions and 11 deletions

View File

@@ -14,6 +14,15 @@ NS_ASSUME_NONNULL_BEGIN
typedef NSUInteger ASCellNodeAnimation;
typedef enum : NSUInteger {
// Indicates a cell has just became visible
ASCellNodeVisibilityEventVisible,
// Indicates a visible cell has a different visible rect. Its position, percent visible or both have changed.
ASCellNodeVisibilityEventVisibleRectChanged,
// Indicates a cell is no longer visible
ASCellNodeVisibilityEventInvisible,
} ASCellNodeVisibilityEvent;
/**
* Generic cell node. Subclass this instead of `ASDisplayNode` to use with `ASTableView` and `ASCollectionView`.
*/
@@ -90,7 +99,7 @@ typedef NSUInteger ASCellNodeAnimation;
*/
- (instancetype)initWithViewControllerBlock:(ASDisplayNodeViewControllerBlock)viewControllerBlock didLoadBlock:(nullable ASDisplayNodeDidLoadBlock)didLoadBlock;
- (void)visibleNodeDidScroll:(UIScrollView *)scrollView withCellFrame:(CGRect)cellFrame;
- (void)cellNodeVisibilityEvent:(ASCellNodeVisibilityEvent)event inScrollView:(UIScrollView *)scrollView withCellFrame:(CGRect)cellFrame;
@end