Content

Spaces

Unflow provides you with content to show to your users in the form of openers. An opener is always inside a space. By default, this is the "default" space. When you use an opener view without providing a name, the content is all provided from the default space.

You can manually provide the space key to our opener views to limit the content, and you can get all the names of your spaces dynamically from the SDK.

The simplest way to use spaces is the SpacesView. By default, we filter out the default space as we presume you'll be showing that elsewhere. See the quick help for SpacesView to see all the options you can customise.

SpacesView(
    showTitles: true,
    font: .system(size: 12, weight: .medium),
    fontColor: .listHeaderText
)

These will look like our standard banner, but with a header above each one.

Spaces

Alternativley, fetch the spaces directly from the SDK and use them in your own UI.

This is the reccomended way to work with spaces, to ensure that your product team can add new ones if needed.

class YourViewModel {
    private var cancellables: Set<AnyCancellable> = []

    func fetchOpeners() {
        UnflowSDK.client.spaces().receive(on: RunLoop.main).sink { spaces in
            // Do something with the spaces
        }
        .store(in: &cancellables)
    }
}
Previous
Openers