StorylyDelegate
@objc(StorylyDelegate)
public protocol StorylyDelegate
This delegate represents the class which notifies application when an event occurs in StorylyView.
-
This function will let you know that Storyly has completed its network operations and story group list has just shown to the user.
Declaration
Swift
@objc optional func storylyLoaded(_ storylyView: StorylyView, storyGroupList: [StoryGroup], dataSource: StorylyDataSource)
Parameters
storylyView
StorylyView instance in which storyly is loaded
storyGroupList
List of story groups when storyly is loaded
dataSource
Source of the storyly data
-
This function will let you know that Storyly has completed its network operations and had a problem while fetching your stories
Declaration
Swift
@objc optional func storylyLoadFailed(_ storylyView: StorylyView, errorMessage: String)
Parameters
storylyView
StorylyView instance in which storyly is failed to load
errorMessage
Error message of the load fail reason
-
This function will notify your application in case of Swipe Up or CTA Button action.
Declaration
Swift
@objc optional func storylyActionClicked(_ storylyView: StorylyView, rootViewController: UIViewController, story: Story)
Parameters
storylyView
StorylyView instance in which action is occurred
rootViewController
RootViewController of the story view
story
Story in which action is occurred
-
This function will let you know that stories are started to be presented to the users.
Declaration
Swift
@objc optional func storylyStoryPresented(_ storylyView: StorylyView)
Parameters
storylyView
StorylyView instance in which stories are started to shown
-
This function will let you know that programmatic story show are failed.
Declaration
Swift
@objc optional func storylyStoryPresentFailed(_ storylyView: StorylyView, errorMessage: String)
Parameters
storylyView
StorylyView instance that event occurred
errorMessage
Error message of the fail reason
-
This function will let you know that user dismissed the current story while watching it.
Declaration
Swift
@objc optional func storylyStoryDismissed(_ storylyView: StorylyView)
Parameters
storylyView
StorylyView instance in which the story is dismissed
-
This function will allow you to get reactions of users from specific interactive components.
Declaration
Swift
@objc optional func storylyUserInteracted(_ storylyView: StorylyView, storyGroup: StoryGroup, story: Story, storyComponent: StoryComponent)
Parameters
storylyView
StorylyView instance in which the user interacted with a component
storyGroup
Story group in which the user interacted with a component
story
Story in which the user interacted with a component
storyComponent
Interactive component that user is interacted with
-
This function will notify you about all Storyly events and let you to send these events to specific data platforms
Declaration
Swift
@objc optional func storylyEvent(_ storylyView: StorylyView, event: StorylyEvent, storyGroup: StoryGroup?, story: Story?, storyComponent: StoryComponent?)
Parameters
storylyView
StorylyView instance in which the event is received
event
Storyly event type which is received
storyGroup
Story group in which the event is received
story
Story in which the event is received
storyComponent
Interactive story component if event is related with a story component
-
This function will notify you about StorylyView size changed for updating parent view size Only for when using Widget Gallery from Storyly Dashboard.
Declaration
Swift
@objc optional func storylySizeChanged(_ storylyView: StorylyView, size: CGSize)
Parameters
storylyView
StorylyView instance in which the event is received
size
StorylyView size width and height