ASCollectionViewDelegate Protocol Reference
| Conforms to | ASCommonCollectionViewDelegate NSObject |
|---|---|
| Declared in | ASCollectionView.h |
– collectionView:willBeginBatchFetchWithContext:
Receive a message that the collectionView is near the end of its data set and more data should be fetched if necessary.
- (void)collectionView:(ASCollectionView *)collectionView willBeginBatchFetchWithContext:(ASBatchContext *)contextParameters
collectionView |
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.
UICollectionView currently only supports batch events for tail loads. If you require a head load, consider implementing a UIRefreshControl.
Declared In
ASCollectionView.h
– shouldBatchFetchForCollectionView:
Tell the collectionView if batch fetching should begin.
- (BOOL)shouldBatchFetchForCollectionView:(ASCollectionView *)collectionViewParameters
collectionView |
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 collectionView assumes that it should notify its asyncDelegate when batch fetching should occur.
Declared In
ASCollectionView.h
– collectionView:layout:insetForSectionAtIndex:
Passthrough support to UICollectionViewDelegateFlowLayout sectionInset behavior.
- (UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout insetForSectionAtIndex:(NSInteger)sectionParameters
collectionView |
The sender. |
|---|---|
collectionViewLayout |
The layout object requesting the information. |
section |
The index number of the section whose insets are needed. |
Discussion
The same rules apply as the UICollectionView implementation, but this can also be used without a UICollectionViewFlowLayout. https://developer.apple.com/library/ios/documentation/UIKit/Reference/UICollectionViewDelegateFlowLayout_protocol/index.html#//apple_ref/occ/intfm/UICollectionViewDelegateFlowLayout/collectionView:layout:insetForSectionAtIndex:
Declared In
ASCollectionView.h