NUIStyleSheetApplyStep
open class NUIStyleSheetApplyStep : OnboardingStep
Instantiates an OnboardingStep
capable of downloading a theme file from the server and applying the NUIStyleSheet
in the onboarding and restore flows.
There are three types of initializers for the different methods for applying themes:
- 1. If the initializer with the
fileURL
parameter is used, then the theme will be applied from that URL instead of downloading it from the server.
If you wish to use this funcionality in manual mode, you can use this one-liner instead of this class:
NUISettings.loadStylesheetByURL(url: <#URL#>)
- If the initializer with the
APIKeyAuthenticationConfig
parameter is used, then the configured theme, if any, will be downloaded from the Mobile Services. TheApplication Identifier
fromAppParameters
andhost
fromConfigurationProvider
will be also used.
Usage
let apiKeyAuthenticationConfig = APIKeyAuthenticationConfig(apikeys: [<#String#>], isAPIKeyAccessOnly: false, allowAnonymousAccessFlag: true)
NUIStyleSheetApplyStep(apiKeyAuthenticationConfig: apiKeyAuthenticationConfig)
- If the initializer with no parameter is used, then the configured theme, if any, will be downloaded from the Mobile Services using
SAPURLSession
(with the appropriate authentication mechanism configured) andSAPcpmsSettingsParameters
fromOnboardingContext
.
Please note that the SDK prioritizes initializers that have parameters.
-
Declaration
Swift
public init(fileURL: URL)
Parameters
fileURL
URL
of the theme file from which the theme file will be loaded to the UI. -
Declaration
Swift
public init(apiKeyAuthenticationConfig: APIKeyAuthenticationConfig)
Parameters
apikeyAuthenticationConfig
api key configuration needed to download the theme from the server using anonymous access. It will help downloading the theme at the start of the flow.
-
Use this default init when
SAPURLSession
with required authentication observer andSAPcpmsSettingsParameters
have been provided usingOnboardingContext
.Declaration
Swift
public init()
-
Onboarding function with
OnboardingContext
supportDeclaration
Swift
open func onboard(context: OnboardingContext, completionHandler: @escaping (OnboardingResult) -> Void)
Parameters
context
OnboardingContext
object which contains required information to pass on to the following stepcompletionHandler
called when the process of this step finished. same context is returned on success or error in case of failure.
-
Restore function with
OnboardingContext
supportDeclaration
Swift
open func restore(context: OnboardingContext, completionHandler: @escaping (OnboardingResult) -> Void)
Parameters
context
OnboardingContext
object which contains required information to pass on to the following stepcompletionHandler
called when the process of this step finished. same context is returned on success or error in case of failure.
-
Reset function with
OnboardingContext
supportDeclaration
Swift
open func reset(context: OnboardingContext, completionHandler: @escaping () -> Void)
Parameters
context
OnboardingContext
object which contains required information to pass on to the following stepcompletionHandler
called when the process of this step finished. same context is returned on success or error in case of failure.
-
ResetPasscode function with
OnboardingContext
supportDeclaration
Swift
open func resetPasscode(context: OnboardingContext, completionHandler: @escaping (OnboardingResult) -> Void)
Parameters
context
OnboardingContext
object which contains required information to pass on to the following stepcompletionHandler
called when the process of this step finished. same context is returned on success or error in case of failure.