SimpleTaskStep
open class SimpleTaskStep : OnboardingStep
This step is capable of integrating a simple functionality into the onboarding flow, without the need to implement the whole OnboardingStep protocol. Provides a convenient way of using the same piece of logic for both onboard and restore processes.
-
The type of the onboard and restore methods’ completionHandler on the OnboardingStep protocol.
Declaration
Swift
public typealias FlowHandler = (OnboardingContext, @escaping (OnboardingResult) -> Void) -> Void -
The type of the reset method’s completionHandler on the OnboardingStep protocol.
Declaration
Swift
public typealias ResetHandler = (OnboardingContext, @escaping () -> Void) -> Void -
Instantiates the step.
Declaration
Swift
public init(onboardHandler: @escaping FlowHandler, restoreHandler: @escaping FlowHandler, resetPasscodeHandler: @escaping FlowHandler = SimpleTaskStep.defaultFlowHandler, resetHandler: @escaping ResetHandler = SimpleTaskStep.defaultResetHandler)Parameters
onboardHandleronboard logic
restoreHandlerrestore logic
resetPasscodeHandlerreset passcode logic
resetHandlerreset logic
-
Instantiates the step.
Declaration
Swift
public init(onboardHandler: @escaping FlowHandler, restoreHandler: @escaping FlowHandler, backgroundHandler: @escaping FlowHandler, resetPasscodeHandler: @escaping FlowHandler = SimpleTaskStep.defaultFlowHandler, resetHandler: @escaping ResetHandler = SimpleTaskStep.defaultResetHandler)Parameters
onboardHandleronboard logic
restoreHandlerrestore logic
backgroundHandlerbackground logic
resetPasscodeHandlerreset passcode logic
resetHandlerreset logic
-
Instantiates the step.
Declaration
Swift
public init(flowHandler: @escaping FlowHandler, resetHandler: @escaping ResetHandler = SimpleTaskStep.defaultResetHandler)Parameters
flowHandleronboard/restore/background/resetPasscode logic
resetHandlerreset logic
-
Default flow handler logic which just calls the completionHandler
Declaration
Swift
public static func defaultFlowHandler(context: OnboardingContext, completionHandler: (OnboardingResult) -> Void) -
Default reset logic which just calls the completionHandler
Declaration
Swift
public static func defaultResetHandler(context: OnboardingContext, completionHandler: () -> Void)
-
Called when the step fails. Return
.skipto suppress the error and continue the flow, or.failto propagate the error and stop the flow. Default returns.fail.Override this method in a subclass to customize error handling for runtime errors such as network failures. Avoid skipping configuration errors (
OnboardingError.missingArgument,OnboardingError.invalidArgument) as those indicate a programmer error and downstream steps are unlikely to function correctly without the step completing successfully.Declaration
Swift
open func handleError(_: Error) -> OnboardingStepErrorResolution -
Declaration
Swift
public func onboard(context: OnboardingContext, completionHandler: @escaping (OnboardingResult) -> Void) -
Declaration
Swift
public func restore(context: OnboardingContext, completionHandler: @escaping (OnboardingResult) -> Void) -
Declaration
Swift
public func background(context: OnboardingContext, completionHandler: @escaping (OnboardingResult) -> Void) -
Declaration
Swift
public func resetPasscode(context: OnboardingContext, completionHandler: @escaping (OnboardingResult) -> Void) -
Declaration
Swift
public func reset(context: OnboardingContext, completionHandler: @escaping () -> Void)