ASTableDelegate Protocol Reference

Conforms to ASCommonTableViewDelegate
NSObject
Declared in ASTableNode.h

Overview

This is a node-based UITableViewDelegate.

Note that -tableView:heightForRowAtIndexPath: has been removed; instead, your custom ASCellNode subclasses are responsible for deciding their preferred onscreen height in -calculateSizeThatFits:.

– tableNode:constrainedSizeForRowAtIndexPath:

Provides the constrained size range for measuring the row at the index path. Note: the widths in the returned size range are ignored!

- (ASSizeRange)tableNode:(ASTableNode *)tableNode constrainedSizeForRowAtIndexPath:(NSIndexPath *)indexPath

Parameters

tableNode

The sender.

indexPath

The index path of the node.

Return Value

A constrained size range for layout the node at this index path.

Declared In

ASTableNode.h

– tableNode:willBeginBatchFetchWithContext:

Receive a message that the tableView is near the end of its data set and more data should be fetched if necessary.

- (void)tableNode:(ASTableNode *)tableNode willBeginBatchFetchWithContext:(ASBatchContext *)context

Parameters

context

A context object that must be notified when the batch fetch is completed.

tableView

The sender.

Discussion

You must eventually call -completeBatchFetching: with an argument of YES in order to receive future notifications to do batch fetches. This method is called on a background queue.

ASTableView currently only supports batch events for tail loads. If you require a head load, consider implementing a UIRefreshControl.

Declared In

ASTableNode.h

– shouldBatchFetchForTableNode:

Tell the tableView if batch fetching should begin.

- (BOOL)shouldBatchFetchForTableNode:(ASTableNode *)tableNode

Parameters

tableView

The sender.

Discussion

Use this method to conditionally fetch batches. Example use cases are: limiting the total number of objects that can be fetched or no network connection.

If not implemented, the tableView assumes that it should notify its asyncDelegate when batch fetching should occur.

Declared In

ASTableNode.h

– tableView:willDisplayNode:forRowAtIndexPath:

Informs the delegate that the table view will add the given node at the given index path to the view hierarchy.

- (void)tableView:(ASTableView *)tableView willDisplayNode:(ASCellNode *)node forRowAtIndexPath:(NSIndexPath *)indexPath

Parameters

tableView

The sender.

node

The node that will be displayed.

indexPath

The index path of the row that will be displayed.

Discussion

Warning: AsyncDisplayKit processes table view edits asynchronously. The index path passed into this method may not correspond to the same item in your data source if your data source has been updated since the last edit was processed.

Declared In

ASTableNode.h

– tableView:didEndDisplayingNode:forRowAtIndexPath:

Informs the delegate that the table view did remove the provided node from the view hierarchy. This may be caused by the node scrolling out of view, or by deleting the row or its containing section with @c deleteRowsAtIndexPaths:withRowAnimation: or @c deleteSections:withRowAnimation: .

- (void)tableView:(ASTableView *)tableView didEndDisplayingNode:(ASCellNode *)node forRowAtIndexPath:(NSIndexPath *)indexPath

Parameters

tableView

The sender.

node

The node which was removed from the view hierarchy.

indexPath

The index path at which the node was located before the removal.

Discussion

Warning: AsyncDisplayKit processes table view edits asynchronously. The index path passed into this method may not correspond to the same item in your data source if your data source has been updated since the last edit was processed.

Declared In

ASTableNode.h

– tableView:willBeginBatchFetchWithContext:

Receive a message that the tableView is near the end of its data set and more data should be fetched if necessary.

- (void)tableView:(ASTableView *)tableView willBeginBatchFetchWithContext:(ASBatchContext *)context

Parameters

tableView

The sender.

context

A context object that must be notified when the batch fetch is completed.

Discussion

You must eventually call -completeBatchFetching: with an argument of YES in order to receive future notifications to do batch fetches. This method is called on a background queue.

ASTableView currently only supports batch events for tail loads. If you require a head load, consider implementing a UIRefreshControl.

Declared In

ASTableNode.h

– shouldBatchFetchForTableView:

Tell the tableView if batch fetching should begin.

- (BOOL)shouldBatchFetchForTableView:(ASTableView *)tableView

Parameters

tableView

The sender.

Discussion

Use this method to conditionally fetch batches. Example use cases are: limiting the total number of objects that can be fetched or no network connection.

If not implemented, the tableView assumes that it should notify its asyncDelegate when batch fetching should occur.

Declared In

ASTableNode.h

– tableView:constrainedSizeForRowAtIndexPath:

Provides the constrained size range for measuring the row at the index path. Note: the widths in the returned size range are ignored!

- (ASSizeRange)tableView:(ASTableView *)tableView constrainedSizeForRowAtIndexPath:(NSIndexPath *)indexPath

Parameters

tableView

The sender.

indexPath

The index path of the node.

Return Value

A constrained size range for layout the node at this index path.

Declared In

ASTableNode.h

– tableView:willDisplayNodeForRowAtIndexPath:

Informs the delegate that the table view will add the node at the given index path to the view hierarchy.

- (void)tableView:(ASTableView *)tableView willDisplayNodeForRowAtIndexPath:(NSIndexPath *)indexPath

Parameters

tableView

The sender.

indexPath

The index path of the row that will be displayed.

Discussion

Warning: AsyncDisplayKit processes table view edits asynchronously. The index path passed into this method may not correspond to the same item in your data source if your data source has been updated since the last edit was processed.

This method is deprecated. Use @c tableView:willDisplayNode:forRowAtIndexPath: instead.

Declared In

ASTableNode.h