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
fileURLparameter 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
APIKeyAuthenticationConfigparameter is used, then the configured theme, if any, will be downloaded from the Mobile Services. TheApplication IdentifierfromAppParametersandhostfromConfigurationProviderwill 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) andSAPcpmsSettingsParametersfromOnboardingContext.
Please note that the SDK prioritizes initializers that have parameters.
-
Declaration
Swift
public init(fileURL: URL)Parameters
fileURLURLof the theme file from which the theme file will be loaded to the UI. -
Declaration
Swift
public init(apiKeyAuthenticationConfig: APIKeyAuthenticationConfig)Parameters
apikeyAuthenticationConfigapi 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
SAPURLSessionwith required authentication observer andSAPcpmsSettingsParametershave been provided usingOnboardingContext.Declaration
Swift
public init() -
Onboarding function with
OnboardingContextsupportDeclaration
Swift
open func onboard(context: OnboardingContext, completionHandler: @escaping (OnboardingResult) -> Void)Parameters
contextOnboardingContextobject which contains required information to pass on to the following stepcompletionHandlercalled when the process of this step finished. same context is returned on success or error in case of failure.
-
Restore function with
OnboardingContextsupportDeclaration
Swift
open func restore(context: OnboardingContext, completionHandler: @escaping (OnboardingResult) -> Void)Parameters
contextOnboardingContextobject which contains required information to pass on to the following stepcompletionHandlercalled when the process of this step finished. same context is returned on success or error in case of failure.
-
Reset function with
OnboardingContextsupportDeclaration
Swift
open func reset(context: OnboardingContext, completionHandler: @escaping () -> Void)Parameters
contextOnboardingContextobject which contains required information to pass on to the following stepcompletionHandlercalled when the process of this step finished. same context is returned on success or error in case of failure.
-
ResetPasscode function with
OnboardingContextsupportDeclaration
Swift
open func resetPasscode(context: OnboardingContext, completionHandler: @escaping (OnboardingResult) -> Void)Parameters
contextOnboardingContextobject which contains required information to pass on to the following stepcompletionHandlercalled when the process of this step finished. same context is returned on success or error in case of failure.