SAPFiori
The SAPFiori framework includes a number of UI components that implement the Fiori Design Language. These controls inherit from the Apple UIKit components, and may be utilized programmatically, or via Interface Builder in *.xib or *.storyboard files.
Note: The SAPFiori framework uses APIs that require access to protected resources. App developers must update their app’s info.plist file and add the following property list keys with appropriate purpose strings:
- NSCalendarsUsageDescription
- NSCameraUsageDescription
- NSFaceIDUsageDescription
- NSLocationWhenInUseUsageDescription
- NSMicrophoneUsageDescription
- NSPhotoLibraryUsageDescription
- NSSpeechRecognitionUsageDescription
Installation
- Add SAPFiori.framework and SAPCommon.framework to your Xcode project.
- Add the framework files to the Embedded Binaries section of the General tab for project configuration.
The frameworks should be linked to your project, and appear under the Link Binary with Libraries and Embedded Frameworks sections in the Build Phases tab of your App’s Xcode project settings.
Component Categories
Select from the following categories on the left for implementation details, or related links below for additional design guidelines:
- ListFloorplan – Also see the SAP Fiori Design Guidelines for List Report
- ObjectFloorplan – Also see the SAP Fiori Design Guidelines for Object.
- Onboarding patterns – Also see the SAP Fiori Design Guidelines for Onboarding.
- Object views – Also see the SAP Fiori Design Guidelines for Object Cell and ObjectHeader.
- Contact views – Also see the SAP Fiori Design Guidelines for Contact Cell.
- Timeline views – Also see the SAP Fiori Design Guidelines for Timeline View and Timeline Preview.
- KPI view – Also see the SAP Fiori Design Guidelines for KPIs.
- Grid view – Also see the SAP Fiori Design Guidelines for Grid Layout.
- Map view – Also see the SAP Fiori Design Guidelines for Map.
- Create and filter patterns – Also see the SAP Fiori Design Guidelines for Create and Filter patterns.
- Attachments controller – Also see the SAP Fiori Design Guidelines for Attachment type.
- Collection views – Also see the SAP Fiori Design Guidelines for Collection View.
- Overview patterns – Also see the SAP Fiori Design Guidelines for Header and Overview.
- Feedback Indicators – Also see the SAP Fiori Design Guidelines for Feedback.
- Search bar and barcode scan – Also see the SAP Fiori Design Guidelines for Search and Scan View.
- Branding and theming – Also see the SAP Fiori Design Guidelines for Branding.
- Calendar View - Also see the SAP Fiori Design Guidelines for Calendar.
- Hierarchy View - Also see the SAP Fiori Design Guidelines for Hierarchy.
- Page View - Also see the SAP Fiori Design Guidelines for Sibling Navigation.
- IBDesignable experimental
Additional Component Notes
The following components inherit from Apple UIKit UITableView and UITableViewCell
FUIBaseTableViewCellandNibDesignableFUIBaseTableViewCell- Base classes used in most SDK table view cells, supporting Fiori-design cell selection style (isMomentarySelection), and enabling per-cell cell separator removal at the edges of table view sections.FUIObjectTableViewCell- Standard table view cell for displaying general business object data. The cell contains a left stack of icons, an image (square or circle), three levels of text (headline, subheadline, and footnote), a description (only shows up on regular horizontal size mode), and two status attributes (text or icon).FUIContactCell- Contains contact information, including an image, several labels, and an activity component.FUITimelineCell,FUITimelineMarkerCell, andFUITimelinePreviewTableViewCell- Displays a list of items (objects, events, or posts) in chronological order.FUITimelinePreviewTableViewCellis an auto-sizing table view cell container for aFUITimelinePreviewViewinstance.FormKit cells: A collection of
UITableViewCellsubclasses, that are used to construct table views for creating or editing business objects, or for building filter controls.FormKitcells provide change handlers to respond to user interaction. Those extendingFUIInlineValidationTableViewCellalso support inline validation views.FUIGridTableViewCell- A table view cell for displaying aFUIGridRowItem–common for the List Report floorplan.FUIHierarchyItemTableViewCell- A variant ofUITableViewCellto show a collection item’s business object content and hierarchy information (e.g. number of children in its next level).
Important:
UITableViewCellsubclasses in the SAPFiori framework are designed to be used with iOS’AutoLayoutengine. To enableAutoLayoutto calculate the correct height of cells, developers should:
- Set the table view’s
estimatedRowHeightproperty to a number that is close to the expected height at runtime. This value will be used, before the cell’s dimensions are calculated, to set the table view’s scrollbar position and height.- Set the table view’s
rowHeightproperty toUITableViewAutomaticDimension, to indicate that theAutoLayoutengine should calculate the correct height for the cell, based upon each cell’s content. See Defining height of a table view cell for details.
The Following Components Inherit From Apple UIKit UICollectionView and UICollectionViewCell
FUIObjectCollectionViewCell- This subclass ofUICollectionViewCellmatches the API of theFUIObjectTableViewCelland is commonly used to display a collection of general business objectsFUISimpleCollectionViewCell- A basicUICollectionViewCellcontaining an image view and label.FUISimplePropertyCollectionViewCell- This subclass ofUICollectionViewCellmatches the views API of theFUITextFieldFormCelland displays a horizontally-aligned key label and value text field.FUIKeyValueCollectionViewCell- This variant ofUICollectionViewCellcontains a vertically-stacked key label and a value text field.FUITimelineCollectionViewCell- This variant ofUICollectionViewCellis typically rendered internally by theFUITimelinePreviewViewcomponent.FUIWhatsNewCollectionViewCell- This variant ofUICollectionViewCellis used to show new feature items inFUIWhatsNewDetailListController. It has a similar setup and layout toFUIObjectCollectionViewCell.FUIHierarchyCollectionItem- This variant ofUICollectionViewCellis used to show a collection item’s business object content and hierarchy information (e.g. number of children in its next level).
The Following Layouts Inherit From Apple UIKit UICollectionViewFlowLayout
FUIHorizontalScrollCollectionViewLayout- A flow layout that aligns all items for a section into a single row.FUIHorizontalFlowCollectionViewLayout- A flow layout that provides the option to scale collection cell items’ dimensions upwards, to fill the collection content width.FUIStandardAutoSizingColumnFlowLayout- A flow layout that arranges collection cell items into a grid, where each row is top-aligned and items’ widths are stretched to fill the specified number of columns.FUIKeyValueFlowLayout- A variant ofFUIStandardAutoSizingColumnFlowLayoutwith predefined item spacing to implement the SAP Fiori design language for arrangingFUIKeyValueCollectionViewCellitems.FUITimelineCollectionViewHorizontalFlowLayout- A variant ofFUIStandardAutoSizingColumnFlowLayoutthat resizes collection view cell items to lay them out according to a specified number of columns. All items on the same row are resized to have an identical cell height to the height of the tallest cell in that row.FUIHierarchyCollectionViewLayout- A concrete layout class that manages the layout of the hierarchy view.
The following components inherit from Apple UIKit UIView
FUIObjectHeader- Header-style view with API similar toFUIObjectCellpattern. It is typically added toUITableViewas itstableHeaderView.FUIProfileHeader- Header-style view with API similar toFUIContactCellpattern. It is typically added toUITableViewas itstableHeaderView.FUIKPIHeader- Header-style view for displaying sets ofFUIKPIViewinstances. It is typically added toUITableViewas itstableHeaderView.FUIKPIView- A UIView that enables a developer to present “KPI” information in a formatted manner consistent with the SAP Fiori design language.FUITimelinePreviewView- A UIView contains a header and a collection view for showing an excerpt of your project’s milestones in a convenient linear visual presentation.FUIActivityControl- A standalone component that supports user activities, such as phone, email, message, andvideoCall. Used natively inFUIContactCell, and typical inFUIProfileHeaderdesigns.FUIInlineValidationView- An auxiliary view that contains a validation message forFormKitcells. Used natively withinFUIInlineValidationTableViewCell.FUIBannerMessageView- An animated view for presenting notifications and displaying status. Pins toUINavigationBar, orFUIObjectHeader.FUIHierarchyView- A view that manages a collection of items in a multi-column layout.FUISegmentedControl- A horizontal control made up of multiple segments, each segment functioning as a discrete button.FUISignatureCaptureView- A view to be displayed in theFUISignatureCaptureController.FUISideBar- A sidebar view that supports app-level navigation.FUIDataTable- A table to display data (text or image) in columns and rows.
The Following Utility Classes Extend Native UIKit Types
Note
With the introduction of the closure-styled observe API in Swift 4, and support for Smart KeyPaths SE-0161, it is recommended to use the native KVO technique for change observation, rather than the onChangeHandler closure API in FUIImageView, FUILable, and FUITextField, as the native API is very similar and more flexible.
FUIImageView- An enhancedUIImageViewthat supports applying a circular mask to an image, and also a change handler on theimageproperty.FUILabel- Extension toUILabelsupportinginsets: UIEdgeInsetsinintrinsicContentSizecalculation and also a change handler on thetextproperty.FUITextField- Extension toUITextFieldsupporting a change handler on thetextproperty.FUISearchBar- Extension toUISearchBarsupporting a native barcode scanner property.FUINavigationBar- Extension toUINavigationBarsupporting a simple style technique to match the SAP Fiori design language.
Onboarding and Activation
The following user activation and onboarding components allow you to quickly integrate all required onboarding steps into apps and connect to SAP Mobile Services. The onboarding framework supports various onboarding scenarios, including: login screen with demo mode, SAP Cloud ID with OAuth, touch ID, and passcode.
FUIWelcomeScreen- This screen supports application onboarding and displays the application name, instructions on how to start the activation process, and provides the option to run the application in demo mode. The screen comes in two versions: version 1 has no Activation button; version 2 provides an Activation button after the user is redirected to the screen that provides sign in.FUIPasscodeCreateController,FUIPasscodeInputController, andFUIPasscodeChangeController- Provide passcode and Touch ID/Face ID screens to set up a passcode and enable iPhone native biometric ID for application authentication.FUIMultiUserPasscodeController- AFUIPasscodeControllersubclass for the multi-user onboarding use case.
Floorplan
Floorplan provides a quick and easy way to build a full-screen list or sectioned page that comply with List Report and Object patterns, respectively, in the SAP Fiori Design Guidelines. Because floorplan comes with boilerplate code for predefined UI elements and layout, the developer can focus on data binding and user interaction at development time.
FUIListFloorplan- A genericUITableViewControllersubclass for displaying business objects of the same type in a list.FUIObjectFloorplan- A genericUITableViewControllersubclass for displaying the properties of a business object.FUIObjectEditingFloorplan- A floorplan for editing a business object.
Chart
The SDK provides a variety of chart types to help visualize your analytic data. The supported chart types are:
areabarbubblecolumncombodonutlinescatterstackedBarstackedColumnstockwaterfall
In addition, chart floorplan is also a very helpful class when it comes to building a full-screen charting interface that displays additional information, such as chart title, summary view, and legend.
FUIChartView- AUIViewsubclass that displays charts.FUIChartViewDataSource- An object that provides data to the chart view.FUIChartViewDelegate- An object for managing chart selections and customization.FUIChartFloorplanViewController-UIViewControllerimplementation of theFUIChartFloorplanView.FUIChartFloorplanTableViewCell-UITableViewCellcontainer of theFUIChartFloorplanView.FUIChartFloorplanView- View implementation of the chart floorplan.FUIChartTitleView- Chart title component of the chart floorplan.FUIChartTitleTableViewCell-UITableViewCellcontainer of theFUIChartTitleView.FUIChartLegendView- Legend view component of the chart floorplan.FUIChartLegendTableViewCell-UITableViewCellcontainer of theFUIChartLegendView.
Other Components
FUIFeedbackScreen- AUIViewControllerused to display a feedback screen for the application.FUIWhatsNewViewController- AUIViewControllerused to display new features for the application.FUIWhatsNewDetailPageController- Page style controller to be used inFUIWhatsNewViewController.FUIWhatsNewDetailListController- List style controller to be used inFUIWhatsNewViewController.FUISignatureCaptureController- AUIViewControllerused to capture the user’s signature.
Branding and Theming
Controls in the SAPFiori framework may optionally be styled using a CSS-like stylesheet. The SAPFiori framework integrates the open-source NUI framework, which exposes styling properties of UIKit APIs as CSS-like style attributes. The NUI library is embedded in the SAPFiori framework, so no installation is required.
UI components in SAPFiori are styled programmatically by default and are also assigned a list of style classes that are interpretable by the NUI engine. These style classes may be read or modified via the styleClassPath property.
To override the default style of a control at runtime, use a stylesheet (an *.nss file) to modify the class definitions in the stylesheet for the relevant style classes, and then activate the NUI engine at runtime by supplying the stylesheet.
See the
NUIREADMEfor additional information about setting style syntax in the stylesheet.
Developers may assign style classes to any UIView-inheriting control.
Iconography
The SAP Fiori for iOS icon library (FUIIconLibrary) identifies a standard subset of SF Symbols that are aligned with the SAP Fiori design language. This allows us to have a robust collection that offers the familiarity, accessibility, and cohesiveness SAP customers expect across different platforms while still being consistent with the iOS experience.
Coloring and Typography
SAPFiori framework provides its own color palette and typography system (SAP 72) that comply with the Fiori for iOS design guidelines.
All Fiori Colors are dynamic colors, which means they will adjust based on iOS Appearance settings (Light/Dark). Accessing Fiori Color using UIColor.preferredFioriColor(forStyle:).
72 is an SAP patent typeface that delivers a great reading experience to our users. You can get these fonts using UIFont.preferredFioriFont(forTextStyle:). Note that these fonts support Dynamic Type out of the box.
Custom fonts need to be loaded and registered during an app’s runtime. Make sure you call
UIFont.registerFioriFonts()insideapplication(_:didFinishLaunchingWithOptions:)of yourAppDelegate.72 Font is designed to have the same
leadingas Apple’s system font. However, due to the limitations ofUIKit, theleadingproperty is not modifiable inUIFont.SAPFioriprovides a workaround by adding additional line spacing in an attributed string. To get the attributed string with adjusted spacing, usewithPreferredFioriFont(forTextStyle:)on either aStringorNSattributedString.