WelcomeScreenStep

open class WelcomeScreenStep : OnboardingStep, FUIWelcomeControllerDelegate, FUIOnboardingScanViewControllerDelegate

Class for Welcome Screen onboarding step handling UI elements of the Welcome Screen are localizable through the step’s welcomeScreenCustomizationHandler which will be called during the WelcomeStep onboarding process to configure the screen.

## Customization


 // The customized WelcomeStep can be created like the following code snippet
 func configuredWelcomeScreenStep() -> WelcomeScreenStep {
    let discoveryConfigurationTransformer = DiscoveryServiceConfigurationTransformer(applicationID: "sample.application.id", authenticationPath: "sample.application.id")
    let welcomeScreen = WelcomeScreenStep(transformer: discoveryConfigurationTransformer, providers: [FileConfigurationProvider()])

   let welcomeScreenBundle = Bundle(for: WelcomeScreenStep.self)
   let localizedHeadlineLabelText = NSLocalizedString("WelcomeScreenHeadlineLabelKey", tableName: "ExampleTableName", bundle: welcomeScreenBundle, value: "Example Headline Text", comment: "")
   let localizedDetailLabelText = NSLocalizedString("WelcomeScreenDetailLabelKey", tableName: "ExampleTableName", bundle: welcomeScreenBundle, value: "Example Headline Text", comment: "")
   let localizedPrimaryActionButtonText = NSLocalizedString("WelcomeScreenPrimaryActionButtonTextKey", tableName: "ExampleTableName", bundle: welcomeScreenBundle, value: "Example Headline Text", comment: "")
   let localizedFootnoteActionButtonTitleText = NSLocalizedString("WelcomeScreenFootnoteActionButtonTextKey", tableName: "ExampleTableName", bundle: welcomeScreenBundle, value: "Example Headline Text", comment: "")
   let localizedFootnoteLabelText = NSLocalizedString("WelcomeScreenFootnoteLabelTextKey", tableName: "ExampleTableName", bundle: welcomeScreenBundle, value: "Example Headline Text", comment: "")

   welcomeScreen.welcomeScreenCustomizationHandler = { welcomeScreen in
       welcomeScreen.headlineLabel.text = localizedHeadlineLabelText
       welcomeScreen.detailLabel.text = localizedDetailLabelText
       welcomeScreen.primaryActionButton.titleLabel?.text = localizedPrimaryActionButtonText
       welcomeScreen.footnoteActionButton.setTitle(localizedFootnoteActionButtonTitleText, for: .normal)
       welcomeScreen.footnoteLabel.text = localizedFootnoteLabelText
   }

   return welcomeScreen
 }

  • Onboard function for WelcomeScreenStep

    Declaration

    Swift

    open func onboard(presentationDelegate: FlowPresentationDelegate, credentialStore: CodableStoring, completionHandler: @escaping ([OnboardingInfoKey: Any]?, Error?) -> Void)

    Parameters

    presentationDelegate

    delegate to present the WelcomeScreen

    credentialStore

    store to save the credentials in

    completionHandler

    called when the process is finished, returns with a WelcomeScreenOnboardingStepResult

  • Restore function for WelcomeScreenStep

    Declaration

    Swift

    public func restore(credentialStore: CodableStoring, completionHandler: @escaping ([OnboardingInfoKey: Any]?, Error?) -> Void)

    Parameters

    credentialStore

    store to save the credentials in

    completionHandler

    called when the process is finished, returns with a WelcomeScreenOnboardingStepResult

  • This function resets the modifications of WelcomeScreenStep

    Declaration

    Swift

    open func reset(completionHandler: @escaping () -> Void)

    Parameters

    completionHandler

    called when the process finished.

  • FUIWelcomeControllerDelegate shouldContinueUserOnboarding function implementation

    Declaration

    Swift

    open func shouldContinueUserOnboarding(_ welcomeController: SAPFiori.FUIWelcomeController)

    Parameters

    welcomeController

    FUIWelcomeController instance

  • FUIWelcomeControllerDelegate didSelectDemoMode function implementation

    Declaration

    Swift

    open func didSelectDemoMode(_ welcomeController: SAPFiori.FUIWelcomeController)

    Parameters

    welcomeController

    FUIWelcomeController instance

  • FUIWelcomeControllerDelegate willNavigateToScannerScreen implementation

    Declaration

    Swift

    public func welcomeController(_ welcomeController: FUIWelcomeController, willNavigateToScannerScreen scanController: FUIOnboardingScanViewController)

    Parameters

    welcomeController

    FUIWelcomeController instance

    scanController

    FUIOnboardingScanViewController instance

  • FUIWelcomeControllerDelegate shouldTryUserEmail implementation

    Declaration

    Swift

    public func welcomeController(_ welcomeController: FUIWelcomeController, shouldTryUserEmail userEmail: String)

    Parameters

    welcomeController

    FUIWelcomeController instance

    userEmail

    user email entered

  • FUIWelcomeControllerDelegate willNavigateToActivationScreen implementation

    Declaration

    Swift

    public func welcomeController(_ welcomeController: FUIWelcomeController, willNavigateToActivationScreen activationScreen: FUIActivationScreen)

    Parameters

    welcomeController

    FUIWelcomeController instance

    activationScreen

    FUIActivationScreen instance

  • The implementation validates the scanned QR code.

    Declaration

    Swift

    open func scanViewController(_ scanViewController: FUIOnboardingScanViewController, shouldValidateScanResult scanResult: String) -> Bool

    Parameters

    scanViewController

    FUIOnboardingScanViewController instance

    scanResult

    the scanned result as a String

    Return Value

    Bool value which describes if it is valid or not with a true/false value

  • Delegate method called by ConfigurationLoader.loadConfiguration(userInputs:) when configuration data is found, or when the queue has been exhausted with no data found.

    Declaration

    Swift

    public func configurationProvider(_ provider: ConfigurationProviding?, didCompleteWith result: Bool)

    Parameters

    provider

    The configuration provider in the loader’s queue that obtained configuration data, or the last item in the queue if no data was found. Optional to support case where an empty queue was submitted.

    result

    The result of the returned provider’s attempt to retrieve configuration data (see ConfigurationProviding.provideConfiguration(input:)). true if data was found; otherwise, false.

  • 2.  Stop processing indicator
    

    Delegate method called by ConfigurationLoader.loadConfiguration(userInputs:) after its queue’s input requirements have been gathered. This method will only be called if input is needed and was not supplied during ConfigurationLoader.loadConfiguration(userInputs:).

    Declaration

    Swift

    public func configurationProvider(_ loader: ConfigurationLoader, requestedInput: [String: [String: Any]], completionHandler: @escaping ([String: [String: Any]]) -> Void)

    Parameters

    loader

    The configuration loader instance that requires input.

    requestedInput

    The Dictionary of Dictionary objects with the outer key corresponding to a configuration provider that needs the input, and the outer value being a Dictionary describing the required input(s).

    completionHandler

    Callback mechanism to pass input values back to a configuration loader during queue processing.

  • Delegate method called by ConfigurationLoader when an error is encountered during the call to a provider’s ConfigurationProviding.provideConfiguration(input:).

    Declaration

    Swift

    public func configurationProvider(_ provider: ConfigurationProviding, didEncounter error: Error)

    Parameters

    provider

    The configuration provider in the loader’s queue that encountered the error.

    error

    The Error encountered by the configuration provider.

  • Save data using an alternate method. Data supplied in configuration by a calling ConfigurationLoader object will not be retained by that ConfigurationLoader. If reading the data at a later time is required, it is recommended you also implement a mechanism to read data written by this method.

    Declaration

    Swift

    public func persistConfiguration(_ configuration: [AnyHashable : Any])

    Parameters

    configuration

    Data to be saved

  • Requests that this class remove any saved data. For example, if your persistConfiguration(_:) writes the data to some key in UserDefaults, delete that key when this method is called. Called by ConfigurationLoader.resetStoredData().

    Declaration

    Swift

    public func resetPersistedConfiguration()