# IGListAdapterDataSource

    @protocol IGListAdapterDataSource <NSObject>

Implement this protocol to provide data to an `IGListAdapter`.

- `-objectsForListAdapter:`

  Asks the data source for the objects to display in the list.

  #### Declaration

  Objective-C

      - (nonnull NSArray<id<IGListDiffable>> *)objectsForListAdapter:
          (nonnull IGListAdapter *)listAdapter;

  Swift

      func objects(for listAdapter: IGListAdapter!) -> Any!

  #### Parameters

  `listAdapter` | The list adapter requesting this information.

  #### Return Value

  An array of objects for the list.

- `-listAdapter:sectionControllerForObject:`

  Asks the data source for a section controller for the specified object in the list.

  Note

  New section controllers should be initialized here for objects when asked. You may pass any other data to the section controller at this time.

  Section controllers are initialized for all objects whenever the `IGListAdapter` is created, updated, or reloaded. Section controllers are reused when objects are moved or updated. Maintaining the `-[IGListDiffable diffIdentifier]` guarentees this.

  #### Declaration

  Objective-C

      - (nonnull IGListSectionController<IGListSectionType> *)
                     listAdapter:(nonnull IGListAdapter *)listAdapter
      sectionControllerForObject:(nonnull id)object;

  #### Parameters

  `listAdapter` | The list adapter requesting this information.
  `object` | An object in the list.

  #### Return Value

  A new section controller instance that can be displayed in the list.

- `-emptyViewForListAdapter:`

  Asks the data source for a view to use as the collection view background when the list is empty.

  Note

  This method is called every time the list adapter is updated. You are free to return new views every time, but for performance reasons you may want to retain the view and return it here. The infra is only responsible for adding the background view and maintaining its visibility.

  #### Declaration

  Objective-C

      - (nullable UIView *)emptyViewForListAdapter:
          (nonnull IGListAdapter *)listAdapter;

  Swift

      func emptyView(for listAdapter: IGListAdapter!) -> Any!

  #### Parameters

  `listAdapter` | The list adapter requesting this information.

  #### Return Value

  A view to use as the collection view background, or `nil` if you don’t want a background view.

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

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