ClipsListView

Note: All of the example code snippets are using the StorytellerClipsRowView type, however, if you are using StorytellerClipsGridView they will work in exactly the same way.

ClipsListView is a base abstract class for views displaying lists of Clips. The Storyteller SDK offers two implementations of this abstract class:

Attributes

This sections describes attributes common to ClipsListView (see StorytellerClipsRowView) and StorytellerClipsGridView (see StorytellerClipsGridView). Notes are used to mark if there is a difference in property interpretation

ClipsListView base class attributes:

  • delegate: the StorytellerListViewDelegate instance for ClipsListView callbacks (see Implementing StorytellerListViewDelegate methods)
  • collectionId: the collectionId that the list view should show to the user. The default value is null - see below for more details
  • theme: This parameter is used to set the Theme for the ClipsListView. If theme is set to null, then theme set as Storyteller.theme global property is used. The theme determines how the items within the List View are presented as well as various features of the player once it is launched.
  • displayLimit: only display up to this number of tiles in the list.
  • uiStyle: adjust whether ClipsListView renders in light mode, dark mode or follows the system setting.

uiStyle takes the following values:

  • UIStyle.auto - default value, the ClipsListView will adjust its color scheme automatically according to the current system UI mode
  • UIStyle.light - force the ClipsListView to use the light theme
  • UIStyle.dark - force the ClipsListView to use the dark theme

CollectionId

The collectionId property is used to show specific Clips content in the row or grid by supplying a single Collection ID as string. Collection IDs can be defined in the CMS. If no Collection ID is assigned, then no Clips content is displayed.

Example:

let storytellerClipsRow = StorytellerClipsRowView()
storytellerClipsRow.collectionId = "example_collection_id"

Feed Title

The feed title in the Clips player can be configured in the CMS for the Collection. This can be a custom title or image.

Theme

The theme used to render Clips items in the list. It will also be passed to activities launched from the ClipsListView.

Example:

 let storytellerClipsRow = StorytellerClipsRowView()

 let theme = UITheme()
 
 // You can adjust theming here

 storytellerClipsRow.theme = theme

Methods

reloadData

The reloadData method starts loading fresh data for all Clips from the API. On completion, it updates the Clips data, starts prefetching content and updates the read status of the Clips. The onDataLoadStarted and onDataLoadComplete methods on the StorytellerListViewDelegate are called accordingly (the latter with appropriate data depending on the result of the API requests).

let storytellerClipsRow = StorytellerClipsRowView()

storytellerClipsRow.reloadData()
PREVIOUS
Forward Arrow