OnboardingStep

public protocol OnboardingStep : AnyObject

OnboardingStep Represents a step in the onboarding/restoring flow.

  • Implementers must do their appropriate task here based on information can be found int the OnboardingContext and must use the info and credentialStore fields to read/provide/store their obtained/created information

    Declaration

    Swift

    func onboard(context: OnboardingContext, completionHandler: @escaping (OnboardingResult) -> Void)

    Parameters

    context

    the OnboardingContext must contain all the necessary parameters; Config provider steps must put the transformed configuration to here; Steps performing authentications must configure the sapURLSession field accordingly.

    completionHandler

    must be called by the implementers when the step finishes

  • Implementers must do their appropriate task here based on information can be found int he OnboardingContext and must use the info and credentialStore fields to read/provide/store their obtained/created information

    Declaration

    Swift

    func restore(context: OnboardingContext, completionHandler: @escaping (OnboardingResult) -> Void)

    Parameters

    context

    the OnboardingContext must contain all the necessary parameters; Config provider steps must put the transformed configuration to here; Steps performing authentications must configure the sapURLSession field accordingly.

    completionHandler

    must be called by the implementers when the step finishes

  • Implementers must do their appropriate task here based on information found in the OnboardingContext and must use the info and credentialStore fields to read/provide/store their obtained/created information

    Default Implementation

    Implementers must do their appropriate task here based on information found in the OnboardingContext and must use the info and credentialStore fields to read/provide/store their obtained/created information

    Declaration

    Swift

    func background(context: OnboardingContext, completionHandler: @escaping (OnboardingResult) -> Void)

    Parameters

    context

    the OnboardingContext must contain all the necessary parameters; Config provider steps must put the transformed configuration to here; Steps performing authentications must configure the sapURLSession field accordingly.

    completionHandler

    must be called by the implementers when the step finishes

  • Implementers must do their appropriate task here based on information found in the OnboardingContext and must use the info and credentialStore fields to read/provide/store their obtained/created information

    Default Implementation

    Implementers must do their appropriate task here based on information found in the OnboardingContext and must use the info and credentialStore fields to read/provide/store their obtained/created information

    Declaration

    Swift

    func resetPasscode(context: OnboardingContext, completionHandler: @escaping (OnboardingResult) -> Void)

    Parameters

    context

    the OnboardingContext must contain all the necessary parameters; Config provider steps must put the transformed configuration to here; Steps performing authentications must configure the sapURLSession field accordingly.

    completionHandler

    must be called by the implementers when the step finishes

  • When called the step has to clear every stored state which possible so a next onboarding can be started

    Declaration

    Swift

    func reset(context: OnboardingContext, completionHandler: @escaping () -> Void)

    Parameters

    context

    need a context which contains the onboardingID even if the store is closed

    completionHandler

    called when the reset finishes

  • handleError(_:) Default implementation

    Called when a step fails. Return .skip to suppress the error and continue the flow, or .fail to propagate the error and stop the flow. Default returns .fail.

    Default Implementation

    Declaration

    Swift

    func handleError(_ error: Error) -> OnboardingStepErrorResolution