ASSupplementaryNodeSource.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. #import <AsyncDisplayKit/ASDimension.h>
  10. NS_ASSUME_NONNULL_BEGIN
  11. @class ASCellNode;
  12. @protocol ASSupplementaryNodeSource <NSObject>
  13. /**
  14. * A method to provide the node for the item at the given index.
  15. *
  16. * @param elementKind The kind of supplementary element.
  17. * @param index The index of the item.
  18. * @return A node for the supplementary element.
  19. * @see collectionNode:nodeForSupplementaryElementOfKind:atIndexPath:
  20. */
  21. - (ASCellNode *)nodeForSupplementaryElementOfKind:(NSString *)elementKind atIndex:(NSInteger)index;
  22. @optional
  23. /**
  24. * A method to provide the size range used for measuring the supplementary
  25. * element of the given kind at the given index.
  26. *
  27. * @param elementKind The kind of supplementary element.
  28. * @param index The index of the item.
  29. * @return A size range used for asynchronously measuring the node.
  30. * @see collectionNode:constrainedSizeForSupplementaryElementOfKind:atIndexPath:
  31. */
  32. - (ASSizeRange)sizeRangeForSupplementaryElementOfKind:(NSString *)elementKind atIndex:(NSInteger)index;
  33. @end
  34. NS_ASSUME_NONNULL_END