FUIWelcomeScreen
@MainActor
open class FUIWelcomeScreen : FUIWelcomeController, UITextFieldDelegate, FUISolidNavigationBarProtocol, UIScrollViewDelegate
This UIViewController is used to display a welcome/launch screen to the application for onboarding. The screen mainly displays the application name, instructions on how to start the activation process and an option to trigger the demo mode of the application.


Application can implement the FUIWelcomeControllerDelegate protocol, to present the demo mode of the application by adopting with the didSelectDemoMode(_:) function, to proceed sign in by implementing the shouldContinueUserOnboarding(_:) function, to proceed configuration based on the configuration options by implementing the welcomeController(_:willNavigateToActivationScreen:), welcomeController(_:shouldTryUserEmail:), or welcomeController(_:willNavigateToScannerScreen:) functions.
FUIWelcomeScreen is implemented in FUIWelcomeScreen.storyboard. There are two ways to launch the screen:
- Use another story board and use a
Present Modallysegue toFUIWelcomeScreenstoryboard inSAPFioriframework withcom.sap.cp.sdk.ios.SAPFiorias Bundle. App programmer needs to provide the properties needed inUIController‘s prepare for segue function:
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
let vc = segue.destination as! FUIWelcomeScreen
vc.state = .isConfigured
vc.detailLabel.text = "Thank you for downloading SAP Project Companion for Managers."
vc.delegate = self
}
- Programmatically loads it:
let vc = FUIWelcomeScreen.createInstanceFromStoryboard()
vc.state = .isConfigured
vc.detailLabel.text = "Thank you for downloading SAP Project Companion for Managers."
self.navigationController?.pushViewController(vc, animated: true)
Settings for possible welcome screens being launched:
- Launch with Standard: Application contains the necessary configurations to connect to mobile services, and should prompt user to Start.
stateproperty:.isConfiguredconfigurationOptionsproperty: not required. Value would be ignored.delegatefunction(s) to be implemented:shouldContinueUserOnboarding(_:),didSelectDemoMode(_:)ifisDemoAvailableistrue.Welcome Screen Launched with Link: Application has not been configured, and does not use
FUIWelcomeScreenflow to obtain configuration.stateproperty:.notConfiguredconfigurationOptionsproperty: empty valuedelegatefunction(s) to be implemented:didSelectDemoMode(_:)ifisDemoAvailableistrueWelcome Screen Launched with Discovery Service: Application has not been configured, and should prompt the end user for their email address.
stateproperty:.notConfiguredconfigurationOptionsproperty:.discoveryServicedelegatefunction(s) to be implemented:welcomeController(_:shouldTryUserEmail:),didSelectDemoMode(_:)ifisDemoAvailableistrueWelcome Screen Launched with Scanner: Application has not been configured, and should prompt the end user to launch the Barcode Scanner to obtain connection settings.
stateproperty:.notConfiguredconfigurationOptionsproperty:.barcodeScannerdelegatefunction(s) to be implemented:welcomeController(_:willNavigateToScannerScreen:),didSelectDemoMode(_:)ifisDemoAvailableistrueWelcome Screen Launched with Activation: Application has not been configured, and should prompt the end user to pick between email address entry, or the Barcode Scanner, to obtain connection settings.
stateproperty:.notConfiguredconfigurationOptionsproperty: [.discoveryService, .barcodeScanner]delegatefunction(s) to be implemented:welcomeController(_:willNavigateToActivationScreen:),didSelectDemoMode(_:)ifisDemoAvailableistrue
Note that the FUIWelcomeScreen is supported for iPad portrait and landscape orientation and iPhone portrait orientation only.
Since the screen is not supported in iPhone landscape orientation, the app needs to switch to portrait mode before presenting the screen.
And AppDelegate needs to lock the screen orientation when these screens are shown, similar to the following code snippet.
In app’s AppDelegate:
public var inFUIWelcomeScreen: Bool = false
// implement this function to support only portrait orientation when FUIWelcomeScreen is displayed in iPhone.
func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask {
if !inFUIWelcomeScreen {
return .allButUpsideDown
} else {
return .portrait
}
}
Before presenting the FUIWelcomeScreen:
// Let `AppDelegate` know that we are entering the screen
(UIApplication.shared.delegate as! AppDelegate).inFUIWelcomeScreen = true
// Make sure we rotate to portrait mode
let value = UIInterfaceOrientation.portrait.rawValue
UIDevice.current.setValue(value, forKey: "orientation")
// Present the screen
let vc = FUIWelcomeScreen.createInstanceFromStoryboard()
vc.detailLabel.text = "Thank you for downloading SAP Project Companion for Managers."
self.navigationController?.pushViewController(vc, animated: true)
After dismissing the Passcode or Touch ID screen:
onboardingScreen.dismiss(animated: true, completion: nil)
// Let `AppDelegate` know that we are exiting the view
(UIApplication.shared.delegate as! AppDelegate).inFUIWelcomeScreen = false
Theming
Supported style classes
fdlFUIWelcomeScreen
fdlFUIWelcomeScreen_headlineImageView
fdlFUIWelcomeScreen_headlineLabel
fdlFUIWelcomeScreen_detailLabel
fdlFUIWelcomeScreen_emailTextField
fdlFUIWelcomeScreen_primaryActionButton
fdlFUIWelcomeScreen_footnoteLabel
fdlFUIWelcomeScreen_footnoteActionButton
fdlFUIWelcomeScreen_logoImageView
fdlFUIWelcomeScreen_navigationBar
fdlFUIWelcomeScreen_cancelButton
fdlFUIWelcomeScreen_loadingIndicatorView
fdlFUIWelcomeScreen_loadingIndicatorView_activityIndicator
fdlFUIWelcomeScreen_loadingIndicatorView_textLabel
Attention
The delegate object with type
FUIWelcomeControllerDelegateis declared as a weak reference. On deallocation it will be automatically set to nil. To keep it alive as expected, developer should retain the delegate object during its whole execution scope.Developer can replace the logo image in the
FUIWelcomeScreenusing theming nss file. For example:fdlFUIWelcomeScreen_logoImageView { image-name: MyCompanyLogo.png; }Or, developer could use the
logoImageViewproperty to set the logo image directly.
-
Creates a
FUIWelcomeScreenobject from storyboard and intitialize subview compoennts.Declaration
Swift
@MainActor public class func createInstanceFromStoryboard() -> FUIWelcomeScreenReturn Value
A FUIWelcomeScreen object.
-
Headline label - setting
headlineLabel.text displays the welcome headline message on the screen. Framework does not display any default text.Declaration
Swift
@IBOutlet @MainActor public private(set) var headlineLabel: UILabel! { get } -
Detail label - setting
detailLabel.text displays the instruction statement on the screen; otherwise, framework displays the default text.Declaration
Swift
@IBOutlet @MainActor public private(set) var detailLabel: UILabel! { get } -
Illustrated message. The application can configure the
FUIIllustratedMessageby specifying thetitle,body, anddetailImageView. These attributes are used to display the branding image, title, and description of the application, respectively. When using theillustratedMessagefeature and settingshowsIllustratedMessagetotrue, thedetailLabelwill automatically be hidden.Declaration
Swift
@MainActor public private(set) lazy var illustratedMessage: FUIIllustratedMessage { get set } -
An image view to be added to the Welcome screen.
This image view is to be displayed on the top center of the welcome screen and is typically the company logo image. Developer is expected to set the
imageproperty in order to display this image to the passcode views.- The image view will not be displayed if its
imageproperty is not set. - Developer can set the
headlineImageViewSizeproperty to a specified size. Otherwise, the default size will be used whenheadlineImageViewSizeproperty isnil.
Declaration
Swift
@MainActor public var headlineImageView: UIImageView - The image view will not be displayed if its
-
The size of the image view.
If this property is
nil, the default size of 256 px width and 54 px height is used. Note that the the maximum width is limited to 256 px and the maximum height is limited to 54 px.Declaration
Swift
@MainActor public var headlineImageViewSize: CGSize? -
A Boolean flag,
showsIllustratedMessage, determines whether the illustration message is displayed.When
showsIllustratedMessageis set totrue, theillustratedMessagewill be shown and thedetailLabelwill be hidden. Conversely, whenshowsIllustratedMessageis set tofalse, thedetailLabelwill be displayed and theillustratedMessagewill be hidden.The default setting for
showsIllustratedMessageisfalse.Declaration
Swift
@MainActor public var showsIllustratedMessage: Bool { get set } -
Email text field - it is visible only when
stateis.notConfiguredandconfigurationOptionsis.discoveryService.Declaration
Swift
@objc @MainActor public var emailTextField: FUIAutoResizingTextField { get } -
Undocumented
Declaration
Swift
@IBOutlet @MainActor public private(set) var primaryActionButton: FUIOnboardingButton! { get } -
-
Footnote label - Setting
footnoteLabel.text displays the demo message on the screen; otherwise, framework displays the default text.Declaration
Swift
@IBOutlet @MainActor public private(set) var footnoteLabel: UILabel! { get } -
Undocumented
Declaration
Swift
@IBOutlet @MainActor public private(set) var footnoteActionButton: FUIOnboardingButton! { get } -
-
Welcome detail label - setting
welcomeDetailLabel.text displays the welcome detail message on the screen. Framework does not display any default text.Note
Note This property has been deprecated and renamed toheadlineLabel. Please update your code to referenceheadlineLabeldirectly.Declaration
Swift
@available(*, deprecated, message: "This property has been renamed to `headlineLabel`. Please update your code to reference `headlineLabel` directly.") @MainActor public var welcomeDetailLabel: UILabel! { get } -
Undocumented
Declaration
Swift
@MainActor public var signInButton: FUIOnboardingButton! { get } -
Demo label - setting
demoLabel.text displays the demo message on the screen; otherwise, framework displays the default text.Note
Note This property has been deprecated and renamed tofootnoteLabel. Please update your code to referencefootnoteLabeldirectly.Declaration
Swift
@available(*, deprecated, message: "This property has been renamed to `footnoteLabel`. Please update your code to reference `footnoteLabel` directly.") @MainActor public var demoLabel: UILabel! { get } -
Undocumented
Declaration
Swift
@MainActor public var demoButton: FUIOnboardingButton! { get } -
The message to be displayed under the loading indicator checking account information for Discovery Service.
If this is
nil, the default message is localized “Checking Account…”.Declaration
Swift
@MainActor public var loadingMessage: String? -
Indicates whether to show the Cancel button when checking account information for the Discovery Service.
If the
showsCancelButtonistrue, the Cancel button will be shown upon launching the Welcome screen, andshowsCancelButtonForDiscoveryServicewill not be applied in this case. However, ifshowsCancelButtonisfalseandshowsCancelButtonForDiscoveryServiceistrue, the Cancel button will be added after clicking the button for the Discovery Service.If this is
true, a Cancel button will be displayed on the left side of the navigation bar. The default isfalse.Declaration
Swift
@MainActor public var showsCancelButtonForDiscoveryService: Bool -
Indicates whether to show the Cancel button on Welcome Screen.
If this is
true, a Cancel button will be displayed on the left of the navigation bar. The default isfalse.Declaration
Swift
@MainActor public var showsCancelButton: Bool -
The block to be executed when the user tapped the Cancel button when checking account information for the Discovery Service.
Declaration
Swift
@MainActor public var cancelHandler: (() -> Void)? -
The
UIImageViewfor the logo image.The default is the SAP logo.
Declaration
Swift
@IBOutlet @MainActor public private(set) weak var logoImageView: UIImageView! { get } -
The size of the logo image view.
The default value is
nil. When this property is not set or set tonil,logoImageViewuses a standard size of 60 px width and 28 px height.Declaration
Swift
@MainActor public var logoImageViewSize: CGSize? { get set }
-
The
FUIWelcomeControllerDelegateimplementation.Declaration
Swift
@MainActor public weak var delegate: FUIWelcomeControllerDelegate? -
A flag to indicate demo availability. Default is true. Only when it’s true, display
Want to explorelabel andTry the Demobutton. Correspondingdelegatefunction isdidSelectDemoMode(_:)if the property is true.Declaration
Swift
@MainActor public var isDemoAvailable: Bool { get set } -
A
booleanflag indicating whether the user must agree to a legal agreement before proceeding.When set to
true, a checkbox with user-defined text inlegalTextViewwill be displayed. TheprimaryActionButtonwill remain disabled until the checkbox is selected. Otherwise, both thelegalCheckboxandlegalTextViewwill be hidden.By default, it is set to
false.Declaration
Swift
@MainActor public var isLegalAgreementRequired: Bool { get set } -
A
UITextViewis provided for displaying the legal agreement.It will only be visible when the
isLegalAgreementRequiredflag is set totrue. The application can specify the content of theUITextViewby setting either thetextproperty or theattributedTextproperty, allowing for customization, including formatting or the inclusion of navigation links.Declaration
Swift
@MainActor public var legalTextView: UITextView -
A
UITextViewis designated for displaying text on the footer of the Welcome screen, such as terms of service.The application can then customize the content of the
UITextViewby setting either thetextproperty or theattributedTextproperty, allowing for inclusion of specific formatting or navigation links.Declaration
Swift
@MainActor public var footerTextView: UITextView -
A property to indicate the state in the onboarding process. The default is
.notConfigured, to indicate the application has not been configured and additionally settingconfigurationOptionsto allow end-users to provide configuration settings during onboarding. An.isConfiguredstate indicates that the application contains the necessary configurations to connect to mobile services and should prompt the user to Start.See
See
FUIWelcomeControllerConfigurationOptionfor possible configuration options whenstateis.notConfiguredAlso see
FUIWelcomeControllerDelegatefor possible function(s) to be implemented.
Declaration
Swift
@MainActor public var state: FUIWelcomeControllerState { get set } -
A property to indicate the configuration option(s) in the onboarding process when
stateis.notConfigured. Default sets no configuration options.Also see
FUIWelcomeControllerDelegatefor possible function(s) to be implemented.
Note
Note When state is
.isConfigured, any value set to the property is ignored.Declaration
Swift
@MainActor public var configurationOptions: FUIWelcomeControllerConfigurationOption { get set }
-
Undocumented
Declaration
Swift
@MainActor public func scrollViewDidScroll(_ scrollView: UIScrollView) -
This function is to dismiss the loading indicator view when the email address user entered failed to be validated in Discovery Service.
This has no effect when the validation of the email address is not in progress.
Declaration
Swift
@MainActor open func dismissLoadingIndicator()