# IGListSupplementaryViewSource

    @protocol IGListSupplementaryViewSource <NSObject>

Conform to this protocol to provide information about a list’s supplementary views. This data is used in `IGListAdapter` which then configures and maintains a `UICollectionView`. The supplementary API reflects that in `UICollectionView`, `UICollectionViewLayout`, and `UICollectionViewDataSource`.

- `-supportedElementKinds`

  Asks the SupplementaryViewSource for an array of supported element kinds.

  #### Declaration

  Objective-C

      - (nonnull NSArray<NSString *> *)supportedElementKinds;

  Swift

      func supportedElementKinds() -> Any!

  #### Return Value

  An array of element kind strings that the supplementary source handles.

- `-viewForSupplementaryElementOfKind:atIndex:`

  Asks the SupplementaryViewSource for a configured supplementary view for the specified kind and index.

  Note

  This is your opportunity to do any supplementary view setup and configuration.

  Warning

  You should never allocate new views in this method. Instead deque a view from the `IGListCollectionContext`.

  #### Declaration

  Objective-C

      - (nonnull __kindof UICollectionReusableView *)
      viewForSupplementaryElementOfKind:(nonnull NSString *)elementKind
                                atIndex:(NSInteger)index;

  Swift

      func viewForSupplementaryElement(ofKind elementKind: Any!, atIndex index: Any!) -> Any!

  #### Parameters

  `elementKind` | The kind of supplementary view being requested
  `index` | The index for the supplementary veiw being requested.

- `-sizeForSupplementaryViewOfKind:atIndex:`

  Asks the SupplementaryViewSource for the size of a supplementary view for the given kind and index path.

  #### Declaration

  Objective-C

      - (CGSize)sizeForSupplementaryViewOfKind:(nonnull NSString *)elementKind
                                       atIndex:(NSInteger)index;

  Swift

      func sizeForSupplementaryView(ofKind elementKind: Any!, atIndex index: Any!) -> Any!

  #### Parameters

  `elementKind` | The kind of supplementary view.
  `index` | The index of the requested view.

  #### Return Value

  The size for the supplementary view.

© 2017 Instagram. All rights reserved. (Last updated: 2017-01-04)

Generated by jazzy ♪♫ v0.7.3, a Realm project.