Note: All of the example code snippets are using the
StorytellerClipsRowViewtype, however, if you are using
StorytellerClipsGridViewthey 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:
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:
ClipsListViewcallbacks (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.themeglobal 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
ClipsListViewrenders 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 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.
let storytellerClipsRow = StorytellerClipsRowView() storytellerClipsRow.collectionId = "example_collection_id"
The feed title in the Clips player can be configured in the CMS for the Collection. This can be a custom title or image.
The theme used to render Clips items in the list. It will also be passed to activities launched from the ClipsListView.
let storytellerClipsRow = StorytellerClipsRowView() let theme = UITheme() // You can adjust theming here storytellerClipsRow.theme = theme
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
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()