ASCollectionViewDataSource Protocol Reference
| Conforms to | ASCommonCollectionViewDataSource NSObject |
|---|---|
| Declared in | ASCollectionView.h |
– collectionView:nodeForItemAtIndexPath:
required method
Similar to -collectionView:cellForItemAtIndexPath:.
- (ASCellNode *)collectionView:(ASCollectionView *)collectionView nodeForItemAtIndexPath:(NSIndexPath *)indexPathParameters
collectionView |
The sender. |
|---|---|
indexPath |
The index path of the requested node. |
Return Value
a node for display at this indexpath. Must be thread-safe (can be called on the main thread or a background queue) and should not implement reuse (it will be called once per row). Unlike UICollectionView’s version, this method is not called when the row is about to display.
Declared In
ASCollectionView.h
– collectionView:constrainedSizeForNodeAtIndexPath:
Provides the constrained size range for measuring the node at the index path.
- (ASSizeRange)collectionView:(ASCollectionView *)collectionView constrainedSizeForNodeAtIndexPath:(NSIndexPath *)indexPathParameters
collectionView |
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
ASCollectionView.h
– collectionViewLockDataSource:
Indicator to lock the data source for data fetching in async mode. We should not update the data source until the data source has been unlocked. Otherwise, it will incur data inconsistence or exception due to the data access in async mode.
- (void)collectionViewLockDataSource:(ASCollectionView *)collectionViewParameters
collectionView |
The sender. |
|---|
Declared In
ASCollectionView.h
– collectionViewUnlockDataSource:
Indicator to unlock the data source for data fetching in async mode. We should not update the data source until the data source has been unlocked. Otherwise, it will incur data inconsistence or exception due to the data access in async mode.
- (void)collectionViewUnlockDataSource:(ASCollectionView *)collectionViewParameters
collectionView |
The sender. |
|---|
Declared In
ASCollectionView.h