Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.

Commit

Permalink
Get table view delegate API done
Browse files Browse the repository at this point in the history
  • Loading branch information
Adlai Holler committed Oct 11, 2016
1 parent ab9b7a1 commit dc6363c
Show file tree
Hide file tree
Showing 6 changed files with 228 additions and 145 deletions.
7 changes: 7 additions & 0 deletions AsyncDisplayKit/ASCollectionNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,13 @@ NS_ASSUME_NONNULL_BEGIN
*/
@property (nonatomic, readonly) NSInteger numberOfSections;

/**
* Similar to -visibleCells.
*
* @return an array containing the nodes being displayed on screen.
*/
- (NSArray<__kindof ASCellNode *> *)visibleNodes AS_WARN_UNUSED_RESULT;

/**
* Retrieves the node for the item at the given index path.
*
Expand Down
5 changes: 5 additions & 0 deletions AsyncDisplayKit/ASCollectionNode.mm
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,11 @@ - (NSInteger)numberOfSections
return [self.dataController numberOfSections];
}

- (NSArray<__kindof ASCellNode *> *)visibleNodes
{
return [self.view visibleNodes];
}

- (NSIndexPath *)indexPathForNode:(ASCellNode *)cellNode
{
return [self.dataController indexPathForNode:cellNode];
Expand Down
4 changes: 2 additions & 2 deletions AsyncDisplayKit/ASTableView.h
Original file line number Diff line number Diff line change
Expand Up @@ -415,11 +415,11 @@ ASDISPLAYNODE_DEPRECATED

- (void)tableNode:(ASTableNode *)tableNode didEndDisplayingRowWithNode:(ASCellNode *)node;

- (NSIndexPath *)tableNode:(ASTableNode *)tableNode willSelectRowWithNode:(ASCellNode *)node;
- (nullable ASCellNode *)tableNode:(ASTableNode *)tableNode willSelectRowWithNode:(ASCellNode *)node;

- (void)tableNode:(ASTableNode *)tableNode didSelectRowWithNode:(ASCellNode *)node;

- (NSIndexPath *)tableNode:(ASTableNode *)tableNode willDeselectRowWithNode:(ASCellNode *)node;
- (nullable ASCellNode *)tableNode:(ASTableNode *)tableNode willDeselectRowWithNode:(ASCellNode *)node;

- (void)tableNode:(ASTableNode *)tableNode didDeselectRowWithNode:(ASCellNode *)node;

Expand Down
Loading

0 comments on commit dc6363c

Please sign in to comment.