Object views
-
FUIObjectTableViewCellis theFUIObjectBaseTableViewCellsubclass for presenting business object data in the Fiori Design Language.
Views Available in
FUIObjectTableViewCell:detailImageView: aFUIImageViewview added to the cell unlesscell.preserveDetailImageSpacingis set tofalse. The view is right toiconsStackViewand left toheadlineLabel. The image is scaled to fit with fixed aspect. The image size is set to45pxby45px. Usecell.detailImageto set imageheadlineLabel: anUILabelview is always displayed and intended to display a headline text in the cell. Usecell.headlineTextto set label textsubheadlineLabel: anUILabelview is added3pxbelowheadlineLabelto the cell. Use `cell.subheadlineText" to set label textfootnoteLabel: anUILabelview is added3pxbelowsubheadLabelto the cell. Use `cell.footnoteText" to set label textdescriptionLabel: anUILabelview tended to display a long text in the cell. The view is just belowmainViewin compact view, but is right toheadlineLabeland left tostatusImageView(orstatusLabel) in regular view. Use `cell.descriptionText" to set label textstatusImageView-or-statusLabel: anUIImageView/UILabeladded to the cell for status.statusImageViewgets added with size16pxby16px. The view is left to accessory view and right todescriptionLabel. Usecell.statusTextto set label text orcell.statusImageto set image.substatusImageView-or-substatusLabel: anUIImageView/UILabeladded to the cell under status.substatusImageViewgets added with size16pxby16px. Usecell.substatusTextto set label text orcell.substatusImageto set image. An error will be logged whenaccessoryTypeis not.nonenor.disclosureIndicator, then setting a substatus label text or substatus image as this setting breaks Fiori Design Language pattern.
Usage
Data Binding:
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: FUIObjectTableViewCell.reuseIdentifier, for: indexPath as IndexPath) as! FUIObjectTableViewCell cell.detailImage = UIImage(named: "image.png") cell.headlineText = "Business Object Title" cell.subheadlineText = "Business Object Subtitle" cell.footnoteText = "Business Object Footnote" cell.statusImageView.image = FUIIconLibrary.indicator.veryHighPriority.withRenderingMode(.alwaysTemplate) cell.substatusText = "Status Description" cell.statusDisplayMode = .both cell.statusText = "Status" cell.showDescriptionInCompact = true cell.descriptionText = "Business Object Description (long)" cell.iconImages = ["1"] cell.tags = [FUITag(title: "Tag - 1"), FUITag(title: "Tag - 2")] cell.accessoryType = .disclosureIndicator cell.footnoteIcons = [UIImage(systemName: "person")!, "XY"] cell.footnoteIconsText.text = "Description text for footnote icons." cell.footnoteIconsText.numberOfLines = 0 cell.footnoteIconsTextPosition = .leading cell.actionButton.isHidden = false cell.actionButton.setTitle("Button", for: .normal) return cell }Remark
The labels’numberOfLinesproperty is supported, for limiting the number of lines of the text which will be displayed. If thetextorattributedTextincludes newline characters (for example:\n,\r), then the best practice is to precede those characters by a space, so that the ellipsis indicator does not obscure any text which would otherwise be visible.Icons layout:
Icons may be supplied to the
iconImagesproperty which conform to theFUIGlyphImageprotocol. These include:UIImage,FUIAttributedGlyphImage, andString. It is recommended when supplying image types, to ensure that the rendering mode isalwaysTemplate, so that the default tint color will be applied.The default dimensions of the icon images are
12 x 12pts. It is possible to increase the width allocated to the icons by increasing the value of theiconsColumnWidth: CGFloatproperty, though this is generally discouraged, unless it is necessary to support multiple digits of aStringtype (for example:iconImages = ["24"]may requireiconsColumnWidth = 20.0).In SDK version 3.0, the Fiori Design Guidelines are updated, and now direct that when possible, the icons should be displayed within the leading margin. This will occur automatically, when the leading margin is
>= 10 + iconsColumnWidth. As a result, most device/orientation layouts will apply this by default; to ensure that all view controllers enforce this minimum layout margin, a developer choose to set the layout margin directly on a parentUITableView, or, override thesystemMinimumLayoutMargins: NSDirectionalEdgeInsetsproperty.override var systemMinimumLayoutMargins: NSDirectionalEdgeInsets { var system = super.systemMinimumLayoutMargins system.leading = 22 system.trailing = 22 return system }The
preserveIconStackSpacing: Boolproperty may be used to ensure that the insertion point of the view to the right of the icons layout (detailImageView, orheadlineLabel) has a consistent x-coordinate, regardless of whether a particular cell contains icons. This property is ignored, if the icons are displayed within the margins, as the insertion point of the subsequent view will always bedirectionalLayoutMargins.left.AccessoryViewandEditingAccessoryViewStandard
UITableViewCellaccessoryView,accessoryType, andeditingAccessoryVieware still supported.The
actionAccessoryViewis a specialized view that takes the place of the usualaccessoryView. This view is aFUISingleActionAccessoryViewthat shows an interactable button orprogressView. Changing theactionAccessoryTypechanges the view that is shown. By default, theactionAccessoryTypeis set to.none.The
actionAccessoryViewcan be visible during editing mode whenisActionAccessoryAlsoEditingActionAccessoryis set totrue. By default,isActionAccessoryAlsoEditingActionAccessoryistrue.cell.isActionAccessoryAlsoEditingActionAccessory = false cell.actionAccessoryType = .button cell.actionAccessoryView?.button.style = .fuiRounded cell.actionAccessoryView?.button.titleLabel?.preferredMaxLayoutWidth = 75 cell.actionAccessoryView?.button.setTitle("Follow", for: .normal) cell.actionAccessoryView?.button.setTitle("Unfollow", for: .selected) cell.actionAccessoryView?.button.isPersistentSelection = true cell.actionAccessoryView?.button.isPreservingPreferredMaxLayoutWidth = true cell.actionAccessoryView?.button.didSelectHandler = { button in <#selection handler#> }Theming
Support
TableViewCellclass paths:fdlFUIObjectTableViewCell {}Supported
TableViewCellattributes:tint-color (Color) background-color (Color) background-color-selected (Color)Supported
Textclass paths:fdlFUIObjectTableViewCell_headlineLabel {} fdlFUIObjectTableViewCell_subheadlineLabel {} fdlFUIObjectTableViewCell_footnoteLabel {} fdlFUIObjectTableViewCell_statusLabel {} fdlFUIObjectTableViewCell_substatusLabel {} fdlFUIObjectTableViewCell_descriptionLabel {}Supported
Textattributes:font-color (Color) font-name (FontName) font-style (UIFontTextStyle) font-size (Number) text-align (TextAlign) text-line-clamp (Integer)Supported
ImageViewclass paths:fdlObjectTableViewCell_detailImageView {} fdlObjectTableViewCell_statusImageView {} fdlObjectTableViewCell_substatusImageView {}Supported
ImageViewattributes:image-name (Image) tint-color (Color)Supported
IMAGEclass paths forgroupedAvatarsViewsandfootnoteIconsViews:fdlFUIObjectTableViewCell_avatar_0 {}: IMAGE theme for first image in `groupedAvatarsViews` fdlFUIObjectTableViewCell_avatar_1 {}: IMAGE theme for second image in `groupedAvatarsViews` fdlFUIObjectTableViewCell_footnoteIcon_0 {}: IMAGE theme for first image in `footnoteIconsViews` fdlFUIObjectTableViewCell_footnoteIcon_1 {}: IMAGE theme for second image in `footnoteIconsViews` fdlFUIObjectTableViewCell_footnoteIcon_2 {}: IMAGE theme for third image in `footnoteIconsViews` fdlFUIObjectTableViewCell_footnoteIcon: IMAGE theme for the other images in `footnoteIconsViews`Supported
IMAGEproperties forgroupedAvatarsViewsandfootnoteIconsViews:image-name: String; tint-color: Color; font-color: Color; background-color: ColorSupported
BUTTONclass paths:fdlFUIObjectTableViewCell_actionButton {}Supported
BUTTONproperties:
See moreimage: Image; tint-color: Color;Declaration
Swift
@IBDesignable @MainActor open class FUIObjectTableViewCell : FUIObjectBaseTableViewCell<FUIObjectView> -
FUIObjectCollectionViewCellis the defaultUICollectionViewsubclass for presenting business object data in the Fiori Design Language.Usage
Data Binding:
cell.detailImage = UIImage(named: "image.png") cell.headlineText = "Business Object Title" cell.subheadlineText = "Business Object Subtitle" cell.footnoteText = "Business Object Footnote" cell.statusImageView.image = FUIIconLibrary.indicator.veryHighPriority.withRenderingMode(.alwaysTemplate) cell.substatusText = "Status Description" cell.descriptionText = "Business Object Description (long)" cell.iconImages = ["1"] cell.tags = [FUITag(title: "Tag - 1"), FUITag(title: "Tag - 2")] cell.accessoryType = .disclosureIndicator cell.footnoteIcons = [UIImage(systemName: "person")!, "XY"] cell.footnoteIconsText.text = "Description text for footnote icons." cell.footnoteIconsText.numberOfLines = 0 cell.footnoteIconsTextPosition = .leading cell.actionButton.isHidden = false cell.actionButton.setTitle("Button", for: .normal)Remark
The labels’numberOfLinesproperty is supported, for limiting the number of lines of the text which will be displayed. If thetextorattributedTextincludes newline characters (for example:\n,\r), then the best practice is to precede those characters by a space, so that the ellipsis indicator does not obscure any text which would otherwise be visible.Icons layout:
Icons may be supplied to the
iconImagesproperty which conform to theFUIGlyphImageprotocol. These include:UIImage,FUIAttributedGlyphImage, andString. It is recommended when supplying image types, to ensure that the rendering mode isalwaysTemplate, so that the default tint color will be applied.The default dimensions of the icon images are
12 x 12pts. It is possible to increase the width allocated to the icons by increasing the value of theiconsColumnWidth: CGFloatproperty, though this is generally discouraged, unless it is necessary to support multiple digits of aStringtype (for example:iconImages = ["24"]may requireiconsColumnWidth = 20.0).The
preserveIconStackSpacing: Boolproperty may be used to ensure that the insertion point of the view to the right of the icons layout (detailImageView, orheadlineLabel) has a consistent x-coordinate, regardless of whether a particular cell contains icons. This property is ignored, if the icons are displayed within the margins, as the insertion point of the subsequent view will always bedirectionalLayoutMargins.left.AccessoryViewandEditingAccessoryViewStandard
UITableViewCellaccessoryView,accessoryTypeare supported.The
actionAccessoryViewis a specialized view that takes the place of the usualaccessoryView. This view is aFUISingleActionAccessoryViewthat shows an interactable button orprogressView. Changing theactionAccessoryTypechanges the view that is shown. By default, theactionAccessoryTypeis set to.none.cell.actionAccessoryType = .button cell.actionAccessoryView?.button.style = .fuiRounded cell.actionAccessoryView?.button.titleLabel?.preferredMaxLayoutWidth = 75 cell.actionAccessoryView?.button.setTitle("Follow", for: .normal) cell.actionAccessoryView?.button.setTitle("Unfollow", for: .selected) cell.actionAccessoryView?.button.isPersistentSelection = true cell.actionAccessoryView?.button.isPreservingPreferredMaxLayoutWidth = true cell.actionAccessoryView?.button.didSelectHandler = { button in <#selection handler#> }Theming
Supported
CollectionViewCellclass paths:fdlFUIObjectCollectionViewCell {}Supported
CollectionViewCellattributes:tint-color (Color) background-color (Color) background-color-selected (Color)Supported
Textclass paths:fdlFUIObjectCollectionViewCell_headlineLabel {} fdlFUIObjectCollectionViewCell_subheadlineLabel {} fdlFUIObjectCollectionViewCell_footnoteLabel {} fdlFUIObjectCollectionViewCell_statusLabel {} fdlFUIObjectCollectionViewCell_substatusLabel {} fdlFUIObjectCollectionViewCell_descriptionLabel {}Supported
Textattributes:font-color (Color) font-name (FontName) font-style (UIFontTextStyle) font-size (Number) text-align (TextAlign) text-line-clamp (Integer)Supported
ImageViewclass paths:fdlFUIObjectCollectionViewCell_detailImageView {} fdlFUIObjectCollectionViewCell_statusImageView {} fdlFUIObjectCollectionViewCell_substatusImageView {}Supported
ImageViewattributes:image-name (Image) tint-color (Color)Supported
BUTTONclass paths:fdlFUIObjectCollectionViewCell_actionButton {}Supported
BUTTONproperties:
See moreimage: Image; tint-color: Color;Declaration
Swift
@MainActor open class FUIObjectCollectionViewCell : FUITableViewAccessoryDrawingCollectionViewCell<FUIObjectView>, FUIContentCopyable -
Base view of
FUIObjectTableViewCell. Standard Fiori control for rendering business object data.Example Initialization and Configuration
let view = FUIObjectView() view.detailImage = UIImage(named: <#image#>) view.headlineText = "Edgar Scissorhands" // To enable a default gradient layer behind the placeholder text. view.detailImageView.isGradientLayerEnabled = true // Set placeholder text. view.detailImageView.placeholder.text = "This is a placeholder" view.subheadlineText = "Lorem ipsum datil es iosin Lotios nsiqok" view.footnoteText = "Here is some footer text about Edward" view.statusImageView.image = UIImage(named: <#image#>) view.statusDisplayMode = .both view.substatusDisplayMode = .both view.statusText = "Status Text" view.substatusText = "Active" view.showDescriptionInCompact = true view.descriptionText = "This text is only visible when the cell is in regular horizontal size class." view.iconImages = ["1", FUIIconLibrary.indicator.veryHighPriority.withRenderingMode(.alwaysTemplate)] view.horizontalIcons = [UIImage(named: <#image#>), UIImage(named: <#image#>)] view.preserveIconStackSpacing = true view.preserveDetailImageSpacing = true view.detailImageViewSize = CGSize(width: 45, height: 45) view.isLimitingHeightToMainContent = false view.isApplyingSplitPercent = true view.splitPercent = 0.4 view.tags = [FUITag(title: "Tag - 1"), FUITag(title: "Tag - 2"), FUITag(title: "Tag - 3")] view.avatars = [UIImage(named: "imageName"), UIImage(named: "imageName")] view.avatarSize = CGSize(width: 30, height: 30) view.indicatorImageView.image = UIImage(name: "imageName") view.indicatorImageViewSize = CGSize(width: 16, height: 16) view.footnoteIcons = [FUIIconLibrary.indicator.veryHighPriority.withRenderingMode(.alwaysTemplate), "+2"] view.actionButton.isHidden = false view.actionButton.setTitle("Button", for: .normal)Theming
Supported
ObjectViewclass paths:fdlFUIObjectView {}Supported
ObjectViewattributes:tint-color (Color) background-color (Color)Supported
Textclass paths:fdlObjectCell_headlineLabel {} // deprecated fdlObjectCell_subheadLabel {} // deprecated fdlObjectCell_footnoteLabel {} // deprecated fdlObjectCell_statusLabel {} // deprecated fdlObjectCell_substatusLabel {} // deprecated fdlObjectCell_descriptionLabel {} // deprecated fdlFUIObjectView_headlineLabel {} fdlFUIObjectView_subheadlineLabel {} fdlFUIObjectView_footnoteLabel {} fdlFUIObjectView_statusLabel {} fdlFUIObjectView_substatusLabel {} fdlFUIObjectView_descriptionLabel {}Supported
Textattributes:font-color (Color) font-name (FontName) font-style (UIFontTextStyle) font-size (Number) text-align (TextAlign) text-line-clamp (Integer)Supported
ImageViewclass paths:fdlObjectView_detailImageView {} fdlObjectView_statusImageView {} fdlObjectView_substatusImageView {}Supported
ImageViewattributes:image-name (Image) tint-color (Color)Supported
BUTTONclass paths:fdlFUIObjectView_actionButton {}Supported
BUTTONproperties:image: Image; tint-color: Color;Additional supported style classes
See morefdlFontStyle_headline {} // deprecated fdlFontStyle_subheadline {} // deprecated fdlFontStyle_body {} // deprecatedDeclaration
Swift
@IBDesignable @MainActor open class FUIObjectView : FUIObjectViewBase, FUIObjectViewComponent, FUIIconsComponent, FUIHorizontalIconsComponent, FUITagsComponent, FUIFootnoteIconsComponent, FUIRatingControlComponentextension FUIObjectView: FUIObjectComponent -
View component used in
FUIObjectTableViewCell. Typically not used directly by developer.This view appears as the
accessoryViewto theFUIObjectTableViewCell.Available:
progressView: AFUISingleActionProgressIndicatorused to display progress. Toggle between the states by changing theactionAccessoryType.button: AFUISingleActionButtondisplayed in theFUISingleActionAccessoryView. This button’s width will not exceed 45% of the width of the container. Button height will dynamically resize based on button text. Button text can wrap two lines. Use the button’stitleLabelpreferredMaxLayoutWidthand the button’sisPreservingPreferredMaxLayoutWidthto set the button’s width. Note Developer should changepreferredMaxLayoutWidthdepending on the accessibility text size.actionAccessoryType: AFUITableViewCellActionAccessoryTypetype used to display the button or the different states of theprogressView. Changing theactionAccessoryTypedrives which view is active.
Usage
See morelet singleActionView = FUISingleActionAccessoryView() singleActionView.actionAccessoryType = .button singleActionView.button.setTitle("Follow", for: .normal) singleActionView.button.setTitle("Unfollow", for: .selected) singleActionView.button.titleLabel?.preferredMaxLayoutWidth = 75 singleActionView.button.isPersistentSelection = true singleActionView.button.isPreservingPreferredMaxLayoutWidth = true singleActionView.button.didSelectHandler = { btn in print("Button Selected") }Declaration
Swift
@MainActor public class FUISingleActionAccessoryView : UIView -
Button component used in
FUISingleActionAccessoryView.This view appears as the
accessoryViewto theFUIObjectTableViewCell.Usage
let singleActionButton = FUISingleActionButton() singleActionButton.setTitle("Follow", for: .normal) singleActionButton.setTitle("Unfollow", for: .selected) singleActionButton.titleLabel?.preferredMaxLayoutWidth = 75 singleActionButton.isPersistentSelection = true singleActionButton.isPreservingPreferredMaxLayoutWidth = true singleActionButton.didSelectHandler = { btn in print("Button Selected") }Declaration
Swift
@MainActor open class FUISingleActionButton : FUIButton -
The progress indicator of the
FUIObjectTableViewCellwithin theFUISingleActionAccessoryView.The indicator has an optional selection handler triggered by
UIControlEvent.touchUpInsideUsage
See morelet progressView = FUISingleActionProgressIndicator() progressView.didSelectHandler = { progressView in print("Indicator Selected") }Declaration
Swift
@MainActor public class FUISingleActionProgressIndicator : FUIProgressIndicatorControl -
Enum determining the Action Accessory Type of the
FUISingleActionAccessoryViewin theFUIObjectTableViewCell.Changing the
FUITableViewCellActionAccessoryTypechanges theFUISingleActionAccessoryViewto show the correct view.There are six cases:
none: TableViewCell does not display an actionAccessoryViewbutton: TableViewCell displays theFUISingleActionButtonin the actionAccessoryViewprocessing: TableViewCell displays theFUISingleActionProgressIndicatorin a processing stateloadingPausable: TableViewCell displays theFUISingleActionProgressIndicatorin a loading state that can be pausedloadingStoppable: TableViewCell displays theFUISingleActionProgressIndicatorin a loading state that can be stoppedpausedResumable: TableViewCell displays theFUISingleActionProgressIndicatorin a paused state that can be resumed
Declaration
Swift
public enum FUITableViewCellActionAccessoryType -
FUIObjectCellis an Interface-Builder-designable UI component that extendsUIViewfor showing object information. It contains a set of default content views that are common to Fiori Design Language Object Cell types, with the associated constraint implementations and handling for size classes.Views Available in
FUIObjectCell:iconsStackView: aUIStackViewview expected to contain a vertical stack of icons/images in its view content. The view is added to the cell unlesscell.preserveIconStackSpacingis set tofalse. This is the first view in the cell and can be left todetailImageView. Usecell.iconImagesto add image(s) to the stack view. Each icon/image size is set to be16pxby16px.detailImageView: anFUIImageViewview added to the cell unlesscell.preserveDetailImageSpacingis set tofalse. The view is to the right oficonsStackViewand left ofheadlineLabel. The image is scaled to fit with fixed aspect. The image size is set to45pxby45px. Usecell.detailImageto set the image.headlineLabel: aUILabelview is always displayed and intended to display a headline text in the cell. Usecell.headlineTextto set label text.subheadlineLabel: aUILabelview is added3pxbelowheadlineLabelto the cell. Use `cell.subheadlineText" to set label text.footnoteLabel: aUILabelview is added3pxbelowsubheadLabelto the cell. Usecell.footnoteTextto set label text.descriptionLabel: aUILabelview intended to display long text in the cell. It gets displayed only in regular view. The view is to the right ofheadlineLabeland left ofstatusImageView(orstatusLabel). Use `cell.descriptionText" to set label text.statusImageView/statusLabel: aUIImageView/UILabeladded to the cell for status.statusImageViewgets added with size16pxby16px. The view is to the left of accessory view and right ofdescriptionLabel. Usecell.statusTextto set label text orcell.statusImageto set image.substatusImageView/substatusLabel: aUIImageView/UILabeladded to the cell under status.substatusImageViewgets added with size16pxby16px. Usecell.substatusTextto set label text orcell.substatusImageto set image. An error will be logged whenaccessoryTypeis not.nonenor.disclosureIndicator, then setting a substatus label text or substatus image as this setting breaks the Fiori Design Language pattern.accessoryView: aUIViewadded to the view whencell.accessoryTypeis not.none. The view is aUIButtoncustomized inFUIObjectCelland is aligned to the baseline ofheadlineLabelwhen the type is.disclosureIndicator. For any other types, it’s vertically center-aligned and created by Apple native SDK.
Example Initialization and Configuration
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: ObjectTableViewCell.reuseIdentifier, for: indexPath as IndexPath) as! ObjectTableViewCell cell.detailImage = UIImage(named: "ProfilePic") // To enable a default gradient layer behind the placeholder text. cell.detailImageView.isGradientLayerEnabled = true // Set placeholder text. cell.detailImageView.placeholder.text = "This is a placeholder" cell.headlineText = "Edgar Scissorhands" cell.subheadlineText = "Lorem ipsum datil es iosin Lotios nsiqok" cell.footnoteText = "Here is some footer text about Edward" cell.statusImageView.image = UIImage(named: "ErrorIcon") cell.substatusText = "Active" cell.descriptionText = "This text is only visible when the cell is in regular horizontal size class." cell.iconImages = [#imageLiteral(resourceName: "clock"), #imageLiteral(resourceName: "check"), #imageLiteral(resourceName: "attention")] cell.accessoryType = .disclosureIndicator return cell }Theming
Supported style classes
See morefdlFUIObjectCell fdlFUIObjectCell_headlineLabel fdlFUIObjectCell_subheadLabel fdlFUIObjectCell_footnoteLabel fdlFUIObjectCell_statusLabel fdlFUIObjectCell_substatusLabel fdlFUIObjectCell_descriptionLabelDeclaration
Swift
@available(*, deprecated, message: "Use `FUIObjectView`, instead.") @MainActor open class FUIObjectCell : NibDesignable -
FUIObjectHeaderextendsUIViewfor showing information of an object header. It contains a set of default content views which are common to Fiori Design Language Object Cell types, with the associated constraint implementations and handling for size classes.Regular (Landscape) Horizontal Size Class: Anatomy & Variations




Compact (Portrait) Horizontal Size Class: Anatomy & Variations




Views Available in
FUIObjectHeader:detailImageView: aUIImageViewview added to the view. The image size is set to44pxby44pxin both compact and regular mode. UsedetailImageto set imageheadlineLabel: an UILabel view is always displayed and intended to display a headline text in the view. UseheadlineTextto set label textsubheadlineLabel: an UILabel view is added4pxbelowheadlineLabelto the view. UsesubheadlineTextto set label texttags: a list of tag labels is added4pxbelowsubheadlineLabel. There can be up to 3 tags as a default. App teams can add more tags if needed.labelItems: an array of FUILabelItem added16pxbelowtagsto the view. There can be up to 6 label items. In compact mode, 6 label items are recommended to be fit in 2 rows.descriptionLabel: an UILabel view tended to display a longer text in the view. Description is advised to be concise and not longer than 3 lines in compact mode.statusImageView/statusLabel: anUIImageView/UILabeladded to the view for status.statusImageViewgets added with size16pxby16px. The view is right toheadlineLabel. UsestatusTextto set label text orstatusImageto set image.substatusImageView/substatusLabel: anUIImageView/UILabeladded to the view under status.substatusImageViewgets added with size16pxby16px. UsesubstatusTextto set label text orsubstatusImageto set image.kpiView: aFUIKPIViewadded to the right accessory. Only 1 right accessory can be used in an object header. When status and KPIs are both selected, KPI has its priority and the status will move to the status row.detailContentView: aFUIObjectHeaderChartViewin page 2.
Example Initialization and Configuration:
//Programmatically add an Object header to tableview let objectHeader = FUIObjectHeader() self.tableView.tableHeaderView = objectHeader objectHeader.detailImageView.image = #imageLiteral(resourceName: "ProfilePic") objectHeader.headlineLabel.text = "Inspect Electric Pump Motor Long Job Title Example Will Wrap Max# of Lines in the HeadlineLabel" objectHeader.subheadlineLabel.text = "Job 819701." objectHeader.tags = [FUITag(title: "Started"), FUITag(title: "PM01"), FUITag(title: "103-Repair")] objectHeader.labelItems = [ FUILabelItem(text: "Los Altos, CA", image: <#my image#>), FUILabelItem(text: "12/31/2022", image: <#my image#>), FUILabelItem(text: "Natasha Giotra", image: <#my image#>, alignment: .leading)] objectHeader.descriptionLabel.text = "Temperature sensor predicts overheating failure in 4 days Urgent and needs attentions. Temperature sensor predicts overheating failure in 4 days Urgent and needs attentions." objectHeader.statusLabel.text = "High" objectHeader.substatusImageView.image = <#my image#> objectHeader.kpiView = { let kpiView = FUIKPIView() let unit = FUIKPIUnitItem(string: "$") let metric = FUIKPIMetricItem(string: "294") let unit2 = FUIKPIUnitItem(string: "M") kpiView.items = [unit, metric, unit2] kpiView.captionlabel.text = "Sales" return kpiView }() // create a custom `UIView`-subclassing instance, to set to `detailContentView` property. let myAnalytics = AnalyticHeaderDetailView() myAnalytics.chartImageView.image = #imageLiteral(resourceName: "hogwarts") objectHeader.detailContentView = myAnalyticsBackground Color Scheme:
The color scheme of
FUIObjectHeadercan be configured by changing its inner view’sbackgroundColorSchemeproperty. Once changed, the text color, background color and page indicator color will be updated based on the new setting. Developer should configurebackgroundColorSchemebefore overriding these color settings.let objectHeader = FUIObjectHeader() objectHeader.backgroundColorScheme = .darkConstant objectHeader._innerView.pageControl.currentPageIndicatorTintColor = .white objectHeader._innerView.pageControl.pageIndicatorTintColor = .lightGrayNote:
FUIObjectHeaderadded toUITableViewastableHeaderViewis compatible withUIRefreshControladded to the same table view. Note that if anUIRefreshControlobject is set after adding anFUIObjectHeaderobject astableHeaderView, theUIRefreshControlobject must be moved to the front in the table view; otherwise, theUIRefreshControlobject wouldn’t be visible.When
FUIObjectHeaderis added to a table view in a storyboard andUIRefreshControlis added later in a table view controller class’viewDidLoadfunction, the Developer should bring therefreshControlto the front:self.refreshControl = UIRefreshControl() self.refreshControl?.addTarget(self, action: #selector(refreshTriggered), for: .valueChanged) self.refreshControl?.tintColor = UIColor.white //bring refresh control to the front to make it visible self.tableView.bringSubview(toFront: self.refreshControl!)## Theming
Supported
ObjectHeaderclass paths:fdlFUIObjectHeader {}Supported
ObjectHeaderattributes:tint-color (Color) background-color (Color) background-color-scheme (FUIBackgroundColorScheme)Supported
Textclass paths:fdlFUIObjectHeader_headlineLabel {} fdlFUIObjectHeader_subheadlineLabel {} fdlFUIObjectHeader_bodyLabel {} fdlFUIObjectHeader_footnoteLabel {} fdlFUIObjectHeader_descriptionLabel {} fdlFUIObjectHeader_statusLabel {} fdlFUIObjectHeader_substatusLabel {} fdlFUIObjectHeader_labelItem_label {} fdlFUIObjectHeader_statusView_statusLabel {} // deprecated fdlFUIObjectHeader_statusView_substatusLabel {} // deprecatedSupported
Textattributes:font-color (Color) font-name (FontName) font-style (UIFontTextStyle) font-size (Number) text-align (TextAlign) text-line-clamp (Integer)Supported
ImageViewclass paths:fdlFUIObjectHeader_detailImageView {} fdlFUIObjectHeader_statusImageView {} fdlFUIObjectHeader_substatusImageView {} fdlFUIObjectHeader_labelItem_imageView {}Supported
ImageViewattributes:
See moreimage-name (Image) tint-color (Color)Declaration
Swift
@IBDesignable @MainActor open class FUIObjectHeader : FUIBaseHeaderView<FUIObjectHeaderView>, FUIContentCopyable -
Theming
Supported
ObjectHeaderViewclass paths:View {} fdlFUIObjectHeaderView {}Supported
ObjectHeaderViewattributes:tint-color (Color) background-color (Color)Supported
Textclass paths:fdlFUIObjectHeaderView_headlineLabel {} fdlFUIObjectHeaderView_subheadlineLabel {} fdlFUIObjectHeaderView_bodyLabel {} fdlFUIObjectHeaderView_footnoteLabel {} fdlFUIObjectHeaderView_descriptionLabel {} fdlFUIObjectHeaderView_statusLabel {} fdlFUIObjectHeaderView_substatusLabel {} fdlFUIObjectHeaderView_labelItem_label {}Supported
Textattributes:font-color (Color) font-name (FontName) font-style (UIFontTextStyle) font-size (Number) text-align (TextAlign) text-line-clamp (Integer)Supported
ImageViewclass paths:fdlFUIObjectHeaderView_detailImageView {} fdlFUIObjectHeaderView_statusImageView {} fdlFUIObjectHeaderView_substatusImageView {} fdlFUIObjectHeaderView_labelItem_imageView {}Supported
ImageViewattributes:
See moreimage-name (Image) tint-color (Color)Declaration
Swift
@MainActor open class FUIObjectHeaderView : FUIDrawingView, FUIObjectHeaderViewComponent, FUIObjectComponent, FUITagsComponent, FUIContentCopyable -
Chart & KPI content View for presentation in
FUIObjectHeader. Set an instance of this view to theFUIObjectHeader.detailContentViewproperty, for correct layout.Usage
See morelet view = FUIObjectHeaderChartView() view.title.text = "Voltage Readings" view.subtitle.text = "Volatility" view.trend.text = "0.24%"" view.trendImage = FUIIconLibrary.analytics.trendUp.withRenderingMode(.alwaysTemplate) view.trendSemanticColor = UIColor.preferredFioriColor(forStyle: .positive) view.chartView.dataSource = self view.isEnabled = true objectHeader.detailContentView = viewDeclaration
Swift
@MainActor open class FUIObjectHeaderChartView : FUITintableDrawingView<FUIControlState>, FUITitleComponent, FUISubtitleComponent, FUITrendComponent, FUIKPIComponent, FUIKPIAttributesConsumer, FUIKPIAttributesProvider