Configuring the SDK screens

Each of the SDK's view controllers are created using either RequestUi or ZDKHelpCenterUi. They can be configured using UiConfiguration objects. Each view controller can start at least one other view controller, and multi-controller flows are possible. For example, the HelpCenterOverviewController can start ArticleViewController, RequestListController and RequestController -- and each of these can in turn start instances of each other. You can provide your configurations upfront to ensure that the SDK looks and behaves the way you want it to, regardless of which controller you started or where the user went from there. When using the UiConfiguration class in version 3.0.0 or higher of the Support SDK, you need to import CommonUISDK like so:

Swift

import CommonUISDK

Objective-c

#import <CommonUISDK/CommonUISDK-Swift.h>

Creating a UiConfig

The SDK is divided into two main areas, ticketing and Help Center. Configurations for ticketing can be created using RequestUiConfiguration. Configurations for Help Center can be created using HelpCenterUiConfiguration. These objects conform to UiConfiguration, an array of which can be passed when starting any of the SDK's view controllers.

let config = RequestUiConfiguration()
config.subject = "iOS Ticket"
config.tags = ["ios", "mobile"]

Starting a View Controller with UiConfigs

You can use these UiConfiguration objects when calling the build functions of RequestUi and ZDKHelpCenterUi. These take an optional list of UiConfigurations . This allows you to start one Support SDK controller and include a configuration for any number of other Support SDK view controller classes. Example:

let config1 = ...;

let config2 = ...;

let config3 = ...;

let configs = [config1, config2, config3]

let requestController = RequestUi.buildRequestUi(with: configs)

You can then present the view controller however you want. However, it must be contained in a UINavigation controller.

Using multiple UiConfigurations

The SDK supports configuring each controller once for each entry point to the SDK. Each call to build on either RequestUi or ZDKHelpCenterUi can be considered an entry point. For example, you can configure RequestController and pass its UiConfiguration when starting HelpCenterOverviewController. That configuration will be used for any instance of RequestController started subsequently, regardless of whether it is started by HelpCenterOverviewController, ArticleController or RequestListController.

It's not possible to configure multiple versions of UiConfiguration for the same view controller, to be used depending on how the user got there. The SDK will iterate through the collection and use the first appropriate UiConfiguration that it finds.

let config1 = ...; // Instance of RequestUiConfig

let config2 = ...; // Instance of RequestUiConfig

let config3 = ...; // Instance of RequestUiConfig

let helpCenter = ZDKHelpCenterUi.buildHelpCenterOverview(withConfigs: [config1, config2, config3]) // This is effectively the same as the line below.

let helpCenter = ZDKHelpCenterUi.buildHelpCenterOverview(withConfigs: [config1]);

It is possible to configure multiple versions of UiConfiguration for the same view controller if you are using them for different entry points to the SDK.

let config1 = ...; // Instance of RequestUiConfig

let config2 = ...; // Instance of RequestUiConfig

let config3 = ...; // Instance of RequestUiConfig

let helpCenter1 = ZDKHelpCenterUi.buildHelpCenterOverview(withConfigs: [config1])

let requestList = RequestUi.buildRequestList(with: [config2])

let articleUi =  ZDKHelpCenterUi.buildHelpCenterArticle(withArticleId: 123, andConfigs: [config3])