How to customize the ASAP SDK iOS Help Widget UI?
The ASAP SDK allows you to customize the UI of the help widget as required.
Predefined themes
The SDK UI comes with two predefined themes: white and black. The following methods help you apply these themes.
If you want to change the theme, first include the following import statement, which imports the ZohoDeskPortalConfiguration.
Swift
- import ZohoDeskPortalConfiguration
Objective-C
- @import ZohoDeskPortalConfiguration;
Methods for applying the default theme (white)
Swift
- ZDPThemeManager.setTheme(type: .light)
Objective-C
[ZDPThemeManager setThemeWithType:ZDPThemeTypeLight];
Methods for applying the black theme
Swift
- ZDPThemeManager.setTheme(type: .dark)
Objective-C
- [ZDPThemeManager setThemeWithType:ZDPThemeTypeDark];
Swift
ZDPThemeManager.setTheme(type: .system)
Objective-C
- [ZDPThemeManager setThemeWithType:ZDPThemeTypeSystem]
Customized themes
You can also override the default dark and light themes to make the SDK look more like your application.
To update the default light theme:
Swift
ZDPThemeManager.updateLightTheme(theme: <#ZDPThemeProtocol#>)
Objective-C
[ZDPThemeManager updateLightThemeWithTheme:<#ZDPThemeProtocol#>];
To update the default dark theme:
Swift
ZDPThemeManager.updateDarkTheme(theme: <#ZDPThemeProtocol#>)
Objective-C
[ZDPThemeManager updateDarkThemeWithTheme:<#ZDPThemeProtocol#>];
Here, ZDPThemeProtocol contains the properties representing the most used colours across the SDK, such as primaryTextColor and navigationBarTextColor. All properties in the protocol are optional. You can create any class conforming to this protocol, implement one or more properties, and pass an object of that class to the updateLightTheme or updateDarkTheme method. The colours you set in the class will override the default theme.
Updating the SDK's theme is different from setting a theme type. Depending on the theme type you have set, the SDK will always be in a dark or light theme.Using custom fonts
The SDK UI offers a set of default fonts, but you can use fonts of your choice if you need to.
To be able to display custom fonts on the SDK UI, perform these steps:
1. Add the fonts to your project.
2. Edit the info.plist of your app, include the "Fonts provided by application" key in the list.
3. Under this key, list the file names of all the fonts you want to use in the SDK UI.
After adding the fonts to your project, you can customize the SDK UI to display text in that font.
To display the custom font on SDK UI, include the following method in your app code:
Swift
ZDPortalConfiguration.customFontName = <#String#>
Objective-C
ZDPortalConfiguration.customFontName = <#NSString#>;

The help widget displays the system font by default if you do not use a custom font. We have made the font sizes accessible since version 2.0 and above.