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
transformer
ConfigurationTransforming object which transforms the given configurations
providers
ConfigurationProviders to load configurations from
-
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.
-
Onboard function for WelcomeScreenStep with context support
Declaration
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, returns OnboardingResult
-
Restore function for WelcomeScreenStep with context support
Declaration
Swift
public func restore(context: OnboardingContext, completionHandler: @escaping (OnboardingResult) -> Void)
Parameters
context
OnboardingContext
object which contains every information for the OnboardingStepcompletionHandler
called when the process finished, returns OnboardingResult
-
background function with
OnboardingContext
supportDeclaration
Swift
public func background(context: OnboardingContext, completionHandler: @escaping (OnboardingResult) -> Void)
Parameters
context
completionHandler
called when the process finished. Step OnboardingResult filled.
-
resetPasscode function with
OnboardingContext
supportDeclaration
Swift
open func resetPasscode(context: OnboardingContext, completionHandler: @escaping (OnboardingResult) -> Void)
Parameters
context
completionHandler
called when the process finished. Step OnboardingResult filled.
-
This function resets the modifications of WelcomeScreenStep in
OnboardingContext
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.
-
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. If
shouldVerifyQRCodeSignature
is set totrue
then QR Code Signature Validation takes place and the method returns with the validation result.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 duringConfigurationLoader.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
ofDictionary
objects with the outer key corresponding to a configuration provider that needs the input, and the outer value being aDictionary
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’sConfigurationProviding.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 callingConfigurationLoader
object 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
configuration
Data 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()