Adding scroll visibility

This commit is contained in:
Max Gu
2016-02-18 18:00:37 -08:00
parent 205feef58c
commit 03446d97e1
5 changed files with 102 additions and 4 deletions

View File

@@ -16,6 +16,7 @@ typedef NSUInteger ASCellNodeAnimation;
@protocol ASCellNodeLayoutDelegate <NSObject>
- (void)scrollViewDidScroll:(UIScrollView *)scrollView cellFrameInScrollView:(CGRect)cellFrame;
/**
* Notifies the delegate that the specified cell node has done a relayout.
* The notification is done on main thread.
@@ -24,6 +25,19 @@ typedef NSUInteger ASCellNodeAnimation;
* @param sizeChanged `YES` if the node's `calculatedSize` changed during the relayout, `NO` otherwise.
*/
- (void)nodeDidRelayout:(ASCellNode *)node sizeChanged:(BOOL)sizeChanged;
<<<<<<< HEAD
=======
@optional
/**
* Notifies the delegate that the specified cell node has scrolled
*
* @param node: A node informing the delegate about the scroll
* @param cellFrame: The frame of the cell that has just scrolled
*/
- (void)visibleNodeDidScroll:(ASCellNode *)node inScrollView:(UIScrollView *)scrollView withCellFrame:(CGRect)cellFrame;
>>>>>>> 4b8216f... Adding scroll visibility
@end
/**
@@ -75,6 +89,7 @@ typedef NSUInteger ASCellNodeAnimation;
*/
@property (nonatomic, weak) id<ASCellNodeLayoutDelegate> layoutDelegate;
@property (nonatomic, assign) BOOL shouldObserveVisibility;
/*
* ASCellNode must forward touch events in order for UITableView and UICollectionView tap handling to work. Overriding
* these methods (e.g. for highlighting) requires the super method be called.
@@ -107,6 +122,12 @@ typedef NSUInteger ASCellNodeAnimation;
*/
- (instancetype)initWithViewControllerBlock:(ASDisplayNodeViewControllerBlock)viewControllerBlock didLoadBlock:(ASDisplayNodeDidLoadBlock)didLoadBlock;
<<<<<<< HEAD
- (void)updateScrollSituationWithScrollVIew:(UIScrollView *)scrollView;
=======
- (void)_visibleNodeDidScroll:(UIScrollView *)scrollView withCellFrame:(CGRect)cellFrame;
>>>>>>> 4b8216f... Adding scroll visibility
@end