CompositeStep
open class CompositeStep : OnboardingStep
This step collects and executes substeps. The defined queues in SAPcpmsDefaultSteps are available to perform specific operations groupped around a specific behavior:
- SAPURLSession configuration steps
- SAPcpms settings and configuration download steps
- SAPcpms settings and configuration apply steps Example how to initialize a download queue:
let compositeStep = CompositeStep(steps: SAPcpmsDefaultSteps.settingsDownload)
The compositeStep instance now can be placed in the onboarding flow.
The queues are proposals how to run the default flow. The flow is customizable with the available supsteps:
SAPcpmsSessionConfigurationStep
SAPcpmsCorrelationConfigurationStep
LanguageObserverConfigurationStep
SAPcpmsSettingsDownloadStep
SAPcpmsDestinationsDownloadStep
SAPcpmsLogSettingsApplyStep
SAPcpmsUsagePolicyApplyStep
PasscodePolicyApplyStep
SAPcpmsLockWipePolicyApplyStep
Customization
During the onboarding flow, if there is a splash screen which shows a text, that text can be changed/localized.
// The localized CompositeStep can be created like the following code snippet
func customCompositeStep() -> OnboardingStep {
let step = CompositeStep()
let compositeBundle = Bundle(for: CompositeStep)
step.infoScreenText = NSLocalizedString("CompositeStepInfoScreenTextKey", tableName: "ExampleTableName", bundle: compositeBundle, value: "Example Info Screen Text", comment: "")
return step
}
-
Property to set the title of info screen
Declaration
Swift
public var infoScreenText: String
-
Composed queue of selected substeps
Declaration
Swift
public let steps: [OnboardingStep]
-
Initialize object from onboarding substeps
Declaration
Swift
public init(steps: [OnboardingStep])
Parameters
steps
composed queue of selected substeps
-
Onboarding function with
OnboardingContext
supportDeclaration
Swift
open func onboard(context: OnboardingContext, completionHandler: @escaping (OnboardingResult) -> Void)
Parameters
context
OnboardingContext
object which contains every information for the OnboardingStepcompletionHandler
called when the process finished. Error filled on failure.
-
Restore function with
OnboardingContext
supportDeclaration
Swift
open func restore(context: OnboardingContext, completionHandler: @escaping (OnboardingResult) -> Void)
Parameters
context
OnboardingContext
object which contains every information for the OnboardingStepcompletionHandler
called when the process finished. Error filled on failure.
-
Background function with
OnboardingContext
supportDeclaration
Swift
open func background(context: OnboardingContext, completionHandler: @escaping (OnboardingResult) -> Void)
Parameters
context
OnboardingContext
object which contains every information for the OnboardingStepcompletionHandler
called when the process finished. Error filled on failure.
-
resetPasscode function with
OnboardingContext
supportDeclaration
Swift
open func resetPasscode(context: OnboardingContext, completionHandler: @escaping (OnboardingResult) -> Void)
Parameters
context
OnboardingContext
object which contains every information for the OnboardingStepcompletionHandler
called when the process finished. Error filled on failure.
-
This function resets the modifications of
SAPcpmsLogSettingsApplyStep
modifications inOnboardingContext
Declaration
Swift
open func reset(context: OnboardingContext, completionHandler: @escaping () -> Void)
Parameters
context
OnboardingContext
object which contains every information for the OnboardingStepcompletionHandler
called when the process finished.