ASSupplementaryNodeSource.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. //
  2. // ASSupplementaryNodeSource.h
  3. // AsyncDisplayKit
  4. //
  5. // Created by Adlai Holler on 1/19/17.
  6. // Copyright © 2017 Facebook. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. NS_ASSUME_NONNULL_BEGIN
  10. @protocol ASSupplementaryNodeSource <NSObject>
  11. /**
  12. * A method to provide the node for the item at the given index.
  13. *
  14. * @param elementKind The kind of supplementary element.
  15. * @param index The index of the item.
  16. * @return A node for the supplementary element.
  17. * @see collectionNode:nodeForSupplementaryElementOfKind:atIndexPath:
  18. */
  19. - (ASCellNode *)nodeForSupplementaryElementOfKind:(NSString *)elementKind atIndex:(NSInteger)index;
  20. @optional
  21. /**
  22. * A method to provide the size range used for measuring the supplementary
  23. * element of the given kind at the given index.
  24. *
  25. * @param elementKind The kind of supplementary element.
  26. * @param index The index of the item.
  27. * @return A size range used for asynchronously measuring the node.
  28. * @see collectionNode:constrainedSizeForSupplementaryElementOfKind:atIndexPath:
  29. */
  30. - (ASSizeRange)sizeRangeForSupplementaryElementOfKind:(NSString *)elementKind atIndex:(NSInteger)index;
  31. @end
  32. NS_ASSUME_NONNULL_END