Datasource

By itself, both cell view and layout section does not do anything by itself. The datasource is powerful object which manages cell views, layout sections and data which then will updates the collection view.

Basically, for a collection view to works properly, you need to

  1. Create cell views
  2. Create layout sections
  3. Use datasource to setup the data, cell views and layouts.
Datasource object at View List


Datasource Inspector

Figure below shows datasource inspector.

1. Section count attribute

Here, you can set how many sections are required for the collection view.

2. Selected section segment attributes

Attributes explanation:

  1. (Order): Popup to select which section to modify.
  2. Layout: Choose layout section of selected section. The layout will define the views arrangement on the collection view.
  3. Section name: Section name which is displayed at the top of (2)
  4. Cell count: Total number of cell for selected section.
  5. Cell view: Choose cell view to be displayed for cell in selected section.
  6. Header Top Leading: Choose which header view to be displayed for the header. This attribute is dynamic and shown based on how type and if headers/footers available for selected layout section.

3. (Header Top Leading) segment attributes

Attributes explanation:

  1. (Header Top Leading): Popup to select which header to modify.
  2. All attributes inside this segment are derived attributes which are based on the selected header view.

4. (Cell 2) segment attributes

Attributes explanation:

  1. (Cell 2): Popup to select which cell index to modify
  2. All attributes inside this segment are derived attributes which are based on the selected cell view. Each cell index may have different data.