# Show/Hide Storyly
This guide shows use cases for showing or hiding Storyly bar in your app. To increase user experience when there are no stories available or stories are not loading using Storyly event handling.
You can also check out the demo on GitHub
Before you begin
You need to have the working Storyly setup as described in Quick Start
# Show Storyly
Use case for showing storyly if StorylyView is loaded and stories are available.
Add StorylyView
to a UIViewController
with parameter isHidden
as true
. Initialize StorylyView with token from dashboard.
For not to show already visible StorylyView bar, check if initially load and storyGroupList
size. Set StorylyView
parameter isHidden
to false
.
Event handling
storylyLoaded
event triggers first for available cached stories and second for request response with current stories.
Detailed information about Event Handling
# Hide Storyly
Use case for hiding storyly if StorylyView is not loaded and stories are not available.
For not to show already visible StorylyView bar, check if initially loaded and storyGroupList
size. Set StorylyView
property isHidden
to false
.
Loading cached stories triggers storylyLoaded
event before storylyLoadFailed
event. Check for if cache loaded and storyGroupList
size. If cache is not loaded set StorylyView
parameter isHidden
to true
.
Event handling
storylyLoaded
event triggers first for available cached stories and later for up to date stories.
storylyLoaded
for cached stories will trigger before storylyLoadFailed
.
Detailed information about Event Handling