WelcomeScreenStep
open class WelcomeScreenStep : OnboardingStep, FUIWelcomeControllerDelegate, FUIOnboardingScanViewControllerDelegate
extension WelcomeScreenStep: ConfigurationLoaderDelegate
extension WelcomeScreenStep: ConfigurationPersisting
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
}
-
provide custom scan confirmation view, defaults to FUIOnboardingScanConfirmView
Declaration
Swift
public var scanConfirmView: UIView? -
Customization of welcome screen UI components.
Declaration
Swift
public var welcomeScreenCustomizationHandler: ((WelcomeStepUI) -> Void)? -
Customization of activation screen UI components.
Declaration
Swift
public var activationScreenCustomizationHandler: ((ActivationStepUI) -> Void)? -
Runs the restore method during onboarding if the store, and the configuration in it exists. By default this value is false.
Declaration
Swift
public var runRestoreIfStoreExists: Bool -
Customization of FUIOnboardingScanConfirmView UI components.
Declaration
Swift
public var scanConfirmViewCustomizationHandler: ((ScanConfirmViewUI, [AnyHashable : Any?]) -> Void)? -
Option to enable/disable photo library in FUIOnboardingScanViewController. The default value is
false.Declaration
Swift
public var useCameraOnlyInScanView: Bool -
Option to enable/disable scanned QR code signature verification. The default value is
false.Declaration
Swift
public var isDigitallySignedQRCodeEnabled: Bool -
WelcomeScreen OnboardingStep initializer function
Declaration
Swift
public required init(transformer: ConfigurationTransforming = DiscoveryServiceConfigurationTransformer(), providers: [ConfigurationProviding]? = nil)Parameters
transformerConfigurationTransforming object which transforms the given configurations
providersConfigurationProviders to load configurations from
-
Onboard function for WelcomeScreenStep
Declaration
Swift
open func onboard(presentationDelegate: FlowPresentationDelegate, credentialStore: CodableStoring, completionHandler: @escaping ([OnboardingInfoKey : Any]?, Error?) -> Void)Parameters
presentationDelegatedelegate to present the
WelcomeScreencredentialStorestore to save the credentials in
completionHandlercalled 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
credentialStorestore to save the credentials in
completionHandlercalled 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
completionHandlercalled when the process finished.
-
Onboard function for WelcomeScreenStep with context support
Declaration
Swift
open func onboard(context: OnboardingContext, completionHandler: @escaping (OnboardingResult) -> Void)Parameters
contextOnboardingContextobject which contains every information for the OnboardingStepcompletionHandlercalled when the process finished, returns OnboardingResult
-
Restore function for WelcomeScreenStep with context support
Declaration
Swift
public func restore(context: OnboardingContext, completionHandler: @escaping (OnboardingResult) -> Void)Parameters
contextOnboardingContextobject which contains every information for the OnboardingStepcompletionHandlercalled when the process finished, returns OnboardingResult
-
background function with
OnboardingContextsupportDeclaration
Swift
public func background(context: OnboardingContext, completionHandler: @escaping (OnboardingResult) -> Void)Parameters
contextcompletionHandlercalled when the process finished. Step OnboardingResult filled.
-
resetPasscode function with
OnboardingContextsupportDeclaration
Swift
open func resetPasscode(context: OnboardingContext, completionHandler: @escaping (OnboardingResult) -> Void)Parameters
contextcompletionHandlercalled when the process finished. Step OnboardingResult filled.
-
This function resets the modifications of WelcomeScreenStep in
OnboardingContextDeclaration
Swift
open func reset(context: OnboardingContext, completionHandler: @escaping () -> Void)Parameters
contextOnboardingContextobject which contains every information for the OnboardingStepcompletionHandlercalled when the process finished.
-
FUIWelcomeControllerDelegate shouldContinueUserOnboarding function implementation
Declaration
Swift
open func shouldContinueUserOnboarding(_ welcomeController: SAPFiori.FUIWelcomeController)Parameters
welcomeControllerFUIWelcomeController instance
-
FUIWelcomeControllerDelegate didSelectDemoMode function implementation
Declaration
Swift
open func didSelectDemoMode(_ welcomeController: SAPFiori.FUIWelcomeController)Parameters
welcomeControllerFUIWelcomeController instance
-
FUIWelcomeControllerDelegate willNavigateToScannerScreen implementation
Declaration
Swift
public func welcomeController(_ welcomeController: FUIWelcomeController, willNavigateToScannerScreen scanController: FUIOnboardingScanViewController)Parameters
welcomeControllerFUIWelcomeController instance
scanControllerFUIOnboardingScanViewController instance
-
FUIWelcomeControllerDelegate shouldTryUserEmail implementation
Declaration
Swift
public func welcomeController(_ welcomeController: FUIWelcomeController, shouldTryUserEmail userEmail: String)Parameters
welcomeControllerFUIWelcomeController instance
userEmailuser email entered
-
FUIWelcomeControllerDelegate willNavigateToActivationScreen implementation
Declaration
Swift
public func welcomeController(_ welcomeController: FUIWelcomeController, willNavigateToActivationScreen activationScreen: FUIActivationScreen)Parameters
welcomeControllerFUIWelcomeController instance
activationScreenFUIActivationScreen instance
-
The implementation validates the scanned QR code. If
shouldVerifyQRCodeSignatureis set totruethen QR Code Signature Validation takes place and the method returns with the validation result.Declaration
Swift
open func scanViewController(_ scanViewController: FUIOnboardingScanViewController, shouldValidateScanResult scanResult: String) -> BoolParameters
scanViewControllerFUIOnboardingScanViewController instance
scanResultthe 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
providerThe 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.
resultThe result of the returned provider’s attempt to retrieve configuration data (see
ConfigurationProviding.provideConfiguration(input:)).trueif data was found; otherwise,false. -
2. Stop processing indicatorDelegate 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 duringConfigurationLoader.loadConfiguration(userInputs:).Declaration
Swift
public func configurationProvider(_ loader: ConfigurationLoader, requestedInput: [String : [String : Any]], completionHandler: @escaping ([String : [String : Any]]) -> Void)Parameters
loaderThe configuration loader instance that requires input.
requestedInputThe
DictionaryofDictionaryobjects with the outer key corresponding to a configuration provider that needs the input, and the outer value being aDictionarydescribing the required input(s).completionHandlerCallback mechanism to pass input values back to a configuration loader during queue processing.
-
Delegate method called by
ConfigurationLoaderwhen an error is encountered during the call to a provider’sConfigurationProviding.provideConfiguration(input:).Declaration
Swift
public func configurationProvider(_ provider: ConfigurationProviding, didEncounter error: Error)Parameters
providerThe configuration provider in the loader’s queue that encountered the error.
errorThe
Errorencountered by the configuration provider. -
Save data using an alternate method. Data supplied in
configurationby a callingConfigurationLoaderobject will not be retained by thatConfigurationLoader. 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
configurationData to be saved
-
Requests that this class remove any saved data. For example, if your
persistConfiguration(_:)writes the data to some key inUserDefaults, delete that key when this method is called. Called byConfigurationLoader.resetStoredData().Declaration
Swift
public func resetPersistedConfiguration()