[ASCellNode] Fix selection / highlight implementation

This commit is contained in:
Hannah Trosi
2016-06-25 00:22:28 -07:00
parent 42a1227d69
commit 2e4b1ea053
6 changed files with 216 additions and 37 deletions

View File

@@ -12,7 +12,7 @@
#import "ASCellNode.h"
@protocol ASCellNodeLayoutDelegate <NSObject>
@protocol ASCellNodeInteractionDelegate <NSObject>
/**
* Notifies the delegate that the specified cell node has done a relayout.
@@ -27,14 +27,19 @@
*/
- (void)nodeDidRelayout:(ASCellNode *)node sizeChanged:(BOOL)sizeChanged;
/*
* Methods to be called whenever the selection or highlight state changes
* on ASCellNode. UIKit internally stores these values to update reusable cells.
*/
- (void)nodeSelectedStateDidChange:(ASCellNode *)node;
- (void)nodeHighlightedStateDidChange:(ASCellNode *)node;
@end
@interface ASCellNode ()
/*
* A delegate to be notified (on main thread) after a relayout.
*/
@property (nonatomic, weak) id<ASCellNodeLayoutDelegate> layoutDelegate;
@property (nonatomic, weak) id <ASCellNodeInteractionDelegate> interactionDelegate;
/*
* Back-pointer to the containing scrollView instance, set only for visible cells. Used for Cell Visibility Event callbacks.