Supporting Types
-
A wrapper on
See moreString
, supportingUILabel
-like properties fortext
,font
andtextColor
.Declaration
Swift
public class FUIText : FUITextProtocol, ExpressibleByStringLiteral
extension FUIText: Initializable
-
Subclass of UILabel, implementing
onChangeHandler
that is invoked on changes to thevalue
property.Theming
Base class paths:
fdlFUILabel {}
Supported
Text
attributes:
See morefont-color (Color) font-name (FontName) font-style (UIFontTextStyle) font-size (Number) text-align (TextAlign) text-line-clamp (Integer)
Declaration
Swift
open class FUILabel : UILabel, FUIContentCopyable
-
FUIImageView
is an enhanced Fiori styleUIImageView
that provides the option of applying a circular mask to the view’simage
property. The view also exposes properties for specifying the width and color of an optional border around the image.The
contentMode
of theFUIImageView
is set thescaleAspectFit
by defaultRemark
Implements@IBDesignable
Usage
- Initializing programmatically:
let imageView = FUIImageView(image: UIImage(named: "myProfilePic")) //set image view to be circular imageView.isCircular = true // To enable a default gradient layer behind the placehoder text imageView.isGradientLayerEnabled = true // Set placeholder text imageView.placeholder.text = "This is a placehoder" // Set placeholder background color imageView.placeholderBackgroundColor = UIColor.white
- Placing inside a Storyboard or xib:
- Drag and drop an
UIImageView
component to Interface Builder canvas. - Switch class name from
UIImageView
toFUIImageView', and set module to
SAPFiori`. - To apply, set
@IBInspectable
propertyisCircular
, totrue
Declaration
Swift
@IBDesignable open class FUIImageView : UIImageView, FUIObservableValue, InnerViewContainer
extension FUIImageView: FUIGlyphImage
extension FUIImageView: FUIAttributedGlyphImage
-
The
See moreFUITextView
class extendsUITextView
, to support displaying a styled placeholder text string when thetext
property is empty.Declaration
-
Subclass of
UITextField
, which implements theFUIObservableValue
protocol, to observe changes to thetext
property. TheonChangeHandler: ((String?) -> Void)?
closure will be invoked on changes to thetext
property.Theming
Supported style classes
See morefdlFUITextField fdlFUITextField_clearButton fdlFUITextField_secureShowButton fdlFUITextField_secureHideButton
Declaration
Swift
open class FUITextField : UITextField, FUIObservableValue
-
Subclass of
See moreFUITextField
, which supports auto-resizing the text field width based on the text entered.Declaration
Swift
public class FUIAutoResizingTextField : FUITextField
-
This
FUINavigationController
is needed for iOS 13.4 and above devices to control the status bar style used by SAPFiori UI components.Note that before iOS 13.4, it is recommended to use an extension of
UINavigationController
in the application to override thepreferredStatusBarStyle
, as documented inFUIStatusBarStyleHelper
‘s header doc. However, it does not work for iOS 13.4 and later iOS versions. Developers need to use thisFUINavigationController
which overrides thepreferredStatusBarStyle
property of standardUINavigationController
in order for thepreferredStatusBarStyle
to be invoked for iOS 13.4 and above.The application should use
FUINavigationController
instead of standardUINavigationController
when displaying SAPFiori UI components in order for the correct status bar style to be displayed. This functionality is achieved in cooperation withFUIStatusBarStyleHelper
.Application developers can also use
FUINavigationController
in the launch storyboard so that it can useFUIStatusBarStyleHelper
to set the application’s status bar style as needed in other application views as well.Declaration
Swift
@available(*, deprecated, message: "No longer supported. Please use UINavigationController.") open class FUINavigationController : UINavigationController
-
FUINavigationBar
is a subclass of ‘UINavigationBar’ which applies the Fiori Design Language styling by default.It exposes a
bannerView: FUIBannerMessageView
view property, which may be presented, using theFUIBannerMessageView
show()
method. By default, the message is shown centered on screen under the navigation bar.Usage
Configuration
Setup a
FUINavigationBar
in your navigation controller. You can set either in storyboard or programmatically.Presenting
FUIBannerMessageView
guard let navBar = self.navigationController?.navigationBar as? FUINavigationBar else { return } navBar.bannerView?.show(message: "This is a test banner", withDuration: 1, animated: true)
Theming
bar-tint-color
is intended to be used for backward compatibility on iOS 12. In order to customize navigation bar color on iOS 13 or above, developer should either setbackground-color
to apply one color to all bar appearences, or configurestandard-background-color
,scrolledge-background-color
andscrolledge--background-color
as a whole for different color settings.
See moreNavigationBar { background-color: @primary1_darkBackground; background-tint-color: @tintColorDark; }
Declaration
Swift
@IBDesignable open class FUINavigationBar : UINavigationBar
-
Subclass of
UIButton
, which provides for rounded edge and rounded fill styles. It also provides for per-state tint colors, persistent selection, and a closure-styled tap handler.The
FUIButton
implements the Fiori Design Language in default configuration.Usage
Initialization
Init button with expected style (for default, use
.tertiary
).To use
FUIButton
style variants in Interface Builder, the convenience subclassesFUIRoundedButton
(.tertiary
) andFUIRoundedFillButton
(.primary
) are also available.// init with expected style. let normalButton = FUIButton() // equivalent to FUIButton(style: .tertiary) let roundedOutlineButton = FUIButton(style: .secondary) // equivalent to `FUIRoundedButton()` let roundedFilledButton = FUIButton(style: .primary) // equivalent to `FUIRoundedFillButton()`
Setting button style and semantic attribute
There are three button styles supported: primary, secondary, and tertiary. You can also configure the semantic attribute (normal, tint, negative) for the button.
button.style = .primary button.semantic = .negative
Setting title(s)
UIButton
provides two techniques for setting its title:setTitle(_:, for:)
titleLabel.text
The behavior of the (2) is inconsistent, and discouraged by Apple. As a result,
titleLabel.text
should be avoided in favor of techniquesetTitle(_:_:)
. TheFUIButton
will correct the behavior oftitleLabel.text
, ifsetTitle(_:_:)
is not used. However, if the developer at any point invokessetTitle(_:, for:)
directly,FUIButton
will cease to correct fortitleLabel.text
, and will defer to the developer to use the API correctly.button.setTitle("Follow", for: .normal) button.setTitle("Unfollow", for: .selected)
Specify Selection Behavior
The default behavior of
UIButton
is to toggle between.normal
and.highlighted
UIControlState
, on user touches started and touches ended. The.selected
state is never used.FUIButton
supports toggling between.normal
and.selected
UIControlState
, by setting theisPersistentSelection
flag totrue
. This is particularly useful, if using the button to toggle a property. The developer may use theisSelected: Bool
API to toggle cause this transition.button.isPersistentSelection = true // causes button to toggle between `.normal` and `.selected` states on user touch
When
isPersistentSelection == true
, the button may transition briefly through the.highlighted
state, between.selected
and.normal
on user touches. Configure settings for[.selected, .highlighted]
, if implementing custom behavior here.Color Configuration
In any style, you may choose to override the background color for state, which is useful for applying an inverted style.
button.setBackgroundColor(UIColor.preferredFioriColor(forStyle: .tintColorLight), for: .highlighted)
In any style, you may choose to override the title color for state, which is useful for applying an inverted style.
button.setTitleColor(UIColor.preferredFioriColor(forStyle: .header), for: .normal)
You can set whether the border color is applied based on
UIControlState
button.setIsApplyingBorderColor(true, for: .normal)
The
FUIButton
also implements theFUIBackgroundSchemeSupporting
protocol, which enables developers to inform the control whether it is being presented against a ‘light’ background, or ‘dark’ background. The default style of the button will adapt to the background color scheme; defaults to.light
.Size Calculation
The
FUIButton
calculates anintrinsicContentSize
from itsimageView
andtitleLabel
, its various insets, and itsdirectionalLayoutMargins
.To manage the width of the text in the
titleLabel
, use the regularUILabel
API to configure the wrapping behavior.button.titleLabel?.preferredMaxLayoutWidth = 200 button.titleLabel?.lineBreakMode = .byWordWrapping
As an additional configuration option, the
FUIButton
provides a flagisPreservingPreferredMaxLayoutWidth
, which uses thepreferredMaxLayoutWidth
as a minimum width for thetitleLabel
when calculatingintrinsicContentSize
. This is useful, when implementing a fixed-width button with variable texts, or toggling variable-width texts on state.Note
This will not affect the
titleLabel
text wrapping behavior.button.isPreservingPreferredMaxLayoutWidth = true
Selection handler:
Optional closure-based substitute for
addTarget(_:_:_:)
method for handling user taps. Passesself
as input parameter. Is compatible withaddTarget(_:_:_:)
selector registration.If used in combination with the target-action selector registration, handlers will be invoked in the following order:
didSelectHandler
- target-action selector
Theming
Support
Button
class paths:Button {} fdlFUIButton {}
Supported
Button
attributes:tint-color { -selected | -highlighted | -selected-highlighted | -selected-disabled | -disabled } (Color) background-color { -normal | -selected | -highlighted | -selected-highlighted | -selected-disabled | -disabled } { -primary| -secondary| -tertiary } (Color) background-image { -selected | -highlighted | -selected-highlighted | -selected-disabled | -disabled } (Image) content-insets (Box) image-insets (Box) title-insets (Box) shadow-color (Color) shadow-offset (Offset) shadow-opacity (Number) shadow-radius (Number)
Supported
Text
attributes:font-color { -selected | -highlighted | -selected-highlighted | -selected-disabled | -disabled } (Color) font-name (FontName) font-style (UIFontTextStyle) font-size (Number) text-align (TextAlign) text-alpha (Number) text-auto-fit (Boolean) text-line-clamp (Integer) text-shadow-color { -selected | -highlighted | -selected-highlighted | -selected-disabled | -disabled } (Color) text-shadow-offset (Offset)
Supported
ImageView
attributes:image { -highlighted | -selected | -selected-highlightecd | -selected-disabled | -disabled } (Image)
Remark
Thetint-color { -* }
attribute will override thefont-color { -* }
attribute on a state-by-state basis. E.g.tint-color-highlighted
will overridefont-color-highlighted
, but will not affectfont-color
.Declaration
Swift
open class FUIButton : UIButton, FUIButtonClosureHandling, FUIStateSelectable, FUIBackgroundSchemeSupporting, PrepareForReuse
-
Convenience subclass of
FUIButton
implementingFUIButtonStyle.secondary
( previousFUIButtonStyle.fuiRounded
in 7.0 release ), for use in Interface Builder.Declaration
Swift
open class FUIRoundedButton : FUIButton
-
Convenience subclass of
FUIButton
implementingFUIButtonStyle.primary
( previousFUIButtonStyle.fuiRoundedFilled
in 7.0 release), for use in Interface Builder.Declaration
Swift
open class FUIRoundedFillButton : FUIButton
-
FUITag
is an enhancedFUILabel
that applies Fiori Design tag color schemes to the label by default.Usage
- Initializing programmatically:
let tag = FUITag(title: "Tag1")
- Placing inside a Storyboard or xib:
- Drag and drop an
UILabel
component to Interface Builder canvas. - Switch class name from
UILabel
toFUITag
, and set module toSAPFiori
.
Declaration
Swift
public class FUITag : FUITagText
-
FUIText
displayed as a tag withinFUIObjectHeaderView
andFUIMapDetailTagObjectTableViewCell
.Available:
contentInsets
: The contentInsets between the tag border and tag contentcornerRadius
: The corner radius around the tagfillColor
: UIColor inside the tagborderColor
: UIColor around the perimeter of the tag
Initialization and Configuration
See morelet tag = FUITagText("Tag") tag.borderColor = borderColor tag.fillColor = fillColor tag.textColor = textColor tag.font = font
Declaration
Swift
public class FUITagText : FUIText
-
A protocol defines properties that a view supporting validation should have.
See moreDeclaration
Swift
public protocol FUIInlineValidation
-
Simple enumeration for horizontal alignment styles
- left: left-aligned
- center: center-aligned
- right: right-aligned
Declaration
Swift
public enum FUIHorizontalAlignment
-
A protocol for use in
See moreFUIImageView
andFUIAttributedGlyphImage
Declaration
Swift
public protocol FUIGlyphImage
-
A class that implements
See moreFUIAttributedGlyphImage
protocolDeclaration
Swift
public class FUIAttributedImage : FUIAttributedGlyphImage
-
A protocol that adds further requirements to FUIGlyphImage
See moreDeclaration
Swift
public protocol FUIAttributedGlyphImage : FUIGlyphImage
-
FUIPlaceholderImageView
is a variant ofFUIImageView
. Placeholder text can be shown if there is no image set.Typically not used directly by developer.
Theming
Supported class paths:
fdlFUIPlaceholderImageView_placeholder {}
Supported properties:
font-color: Color; font-style: UIFontTextStyle; text-line-clamp: Integer; text-align: NSTextAlignment;
Declaration
Swift
@available(*, deprecated, message: "This has been integrated with FUIImageView, please use that instead") open class FUIPlaceholderImageView : FUIImageView
-
Placeholder view component of
FUIPlaceholderImageView
.Typically not used directly by developer.
Theming
Supported class paths:
fdlFUIPlaceholderView_placeholder {}
Supported properties:
font-color: Color; font-style: UIFontTextStyle; text-line-clamp: Integer; text-align: NSTextAlignment;
See moreDeclaration
Swift
public class FUIPlaceholderView : FUIDrawingView, FUIPlaceholderComponent
-
Special case of FUILabel, used for maintaining backwards compatiblity in controls which were originally developed by laying-out several
FUILabel
instances, but which have been now been transitioned to anNSAttributedStringDrawing
layout technique, in which the contents of several string properties are concatenated intoNSAttributedString
s and laid-out usingNSParagraphStyle
configurations (e.g. FUIObjectTableViewCell).The
FUILabelProxy
may be used by the developer for supplying configurations and text, but will not be laid-out in the parent view. Its configurations and content will be read by aNSAttributedString
concatenation engine.See API and Theming header-doc for
FUILabel
Remark
Should not be used directly by app developer. UseFUILabel
, instead.Declaration
Swift
final public class FUILabelProxy : FUILabel
-
A simple UIView subclass to take email address as input.
Theming
Supported style classes
See morefdlFUIEmailInputView fdlFUIEmailInputView_emailTextField fdlFUIEmailInputView_bottomBorderView
Declaration
Swift
public class FUIEmailInputView : NibDesignable, UITextFieldDelegate
-
This structure describes one input field for user input in the
See moreFUIDynamicAuthenticationScreen
.Declaration
Swift
public struct FUIAuthenticationInformationField