File tree Expand file tree Collapse file tree
examples/ASCollectionView/Sample Expand file tree Collapse file tree Original file line number Diff line number Diff line change 342342 */
343343- (BOOL )shouldBatchFetchForCollectionView : (ASCollectionView *)collectionView ;
344344
345+ @end
346+
347+ @protocol ASCollectionViewDelegateFlowLayout <ASCollectionViewDelegate>
348+
349+ @optional
350+
345351/* *
346352 * Passthrough support to UICollectionViewDelegateFlowLayout sectionInset behavior.
347353 *
348354 * @param collectionView The sender.
349355 * @param collectionViewLayout The layout object requesting the information.
350- * # param section The index number of the section whose insets are needed.
356+ * @ param section The index number of the section whose insets are needed.
351357 *
352358 * @discussion The same rules apply as the UICollectionView implementation, but this can also be used without a UICollectionViewFlowLayout.
353359 * https://developer.apple.com/library/ios/documentation/UIKit/Reference/UICollectionViewDelegateFlowLayout_protocol/index.html#//apple_ref/occ/intfm/UICollectionViewDelegateFlowLayout/collectionView:layout:insetForSectionAtIndex:
354360 *
355361 */
356- - (UIEdgeInsets)collectionView : (UICollectionView *)collectionView layout : (UICollectionViewLayout *)collectionViewLayout insetForSectionAtIndex : (NSInteger )section ;
362+ - (UIEdgeInsets)collectionView : (ASCollectionView *)collectionView layout : (UICollectionViewLayout *)collectionViewLayout insetForSectionAtIndex : (NSInteger )section ;
363+
364+ /* *
365+ * Asks the delegate for the size of the header in the specified section.
366+ */
367+ - (CGSize)collectionView : (ASCollectionView *)collectionView layout : (UICollectionViewLayout *)collectionViewLayout referenceSizeForHeaderInSection : (NSInteger )section ;
368+
369+ /* *
370+ * Asks the delegate for the size of the footer in the specified section.
371+ */
372+ - (CGSize)collectionView : (ASCollectionView *)collectionView layout : (UICollectionViewLayout *)collectionViewLayout referenceSizeForFooterInSection : (NSInteger )section ;
357373
358374@end
359375
Original file line number Diff line number Diff line change @@ -628,7 +628,7 @@ - (ASSizeRange)dataController:(ASDataController *)dataController constrainedSize
628628 }
629629
630630 if (_asyncDelegateImplementsInsetSection) {
631- sectionInset = [_asyncDelegate collectionView: self layout: self .collectionViewLayout insetForSectionAtIndex: indexPath.section];
631+ sectionInset = [( id <ASCollectionViewDelegateFlowLayout>) _asyncDelegate collectionView: self layout: self .collectionViewLayout insetForSectionAtIndex: indexPath.section];
632632 }
633633
634634 if (ASScrollDirectionContainsHorizontalDirection ([self scrollableDirections ])) {
Original file line number Diff line number Diff line change 1313
1414#import < AsyncDisplayKit/AsyncDisplayKit.h>
1515
16- @interface ViewController () <ASCollectionViewDataSource, ASCollectionViewDelegate >
16+ @interface ViewController () <ASCollectionViewDataSource, ASCollectionViewDelegateFlowLayout >
1717{
1818 ASCollectionView *_collectionView;
1919}
@@ -95,7 +95,7 @@ - (void)collectionView:(UICollectionView *)collectionView willBeginBatchFetchWit
9595 [context completeBatchFetching: YES ];
9696}
9797
98- - (UIEdgeInsets)collectionView : (UICollectionView *)collectionView layout : (UICollectionViewLayout *)collectionViewLayout insetForSectionAtIndex : (NSInteger )section {
98+ - (UIEdgeInsets)collectionView : (ASCollectionView *)collectionView layout : (UICollectionViewLayout *)collectionViewLayout insetForSectionAtIndex : (NSInteger )section {
9999 return UIEdgeInsetsMake (20.0 , 20.0 , 20.0 , 20.0 );
100100}
101101
You can’t perform that action at this time.
0 commit comments