FUIObjectCell
@available(*, deprecated, message: "Use `FUIObjectView`, instead.")
@MainActor
open class FUIObjectCell : NibDesignable
FUIObjectCell is an Interface-Builder-designable UI component that extends UIView for 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
fdlFUIObjectCell
fdlFUIObjectCell_headlineLabel
fdlFUIObjectCell_subheadLabel
fdlFUIObjectCell_footnoteLabel
fdlFUIObjectCell_statusLabel
fdlFUIObjectCell_substatusLabel
fdlFUIObjectCell_descriptionLabel
-
Reuse identifier @return String a reuse identifier that describes FUIObjectCell
Declaration
Swift
@MainActor public static var reuseIdentifier: String { get }
-
Icons Stack view that contains a stack of icons/images in its contents. Each icon/image size is set to be
16pxby16px. Count of visible images is limited to the count of active labels in the main stack.Declaration
Swift
@IBOutlet @MainActor public private(set) var iconsStackView: UIStackView! { get } -
Detail image view that contains an image with size of 45px x 45px.
Declaration
Swift
@IBOutlet @MainActor public private(set) var detailImageView: FUIImageView! { get } -
A headline label in the main view with
UIFontTextStyleHeadlinestyle setting as the preferred font. UseheadlineTextto set the label’s text value.Declaration
Swift
@IBOutlet @MainActor public private(set) var headlineLabel: FUILabel! { get } -
A subheader label in the main view with
UIFontTextStyleBodystyle setting as the preferred font. UsesubheadlineTextto set the label’s text value.Declaration
Swift
@IBOutlet @MainActor public private(set) var subheadlineLabel: FUILabel! { get } -
A footnote label in the main view with
UIFontTextStyleSubheadlinestyle setting as the preferred font. UsefootnoteTextto set the label’s text value.Declaration
Swift
@IBOutlet @MainActor public private(set) var footnoteLabel: FUILabel! { get } -
A description label displayed in the description view when size class is .regular. Use
descriptionTextto set the label’s text value.Declaration
Swift
@IBOutlet @MainActor public private(set) var descriptionLabel: FUILabel! { get } -
A status label displayed in the status view. Use
statusTextto set the label’s text value. Status Label and status image cannot coexist in display. When both are set, only the last one set gets displayed.Declaration
Swift
@IBOutlet @MainActor public private(set) var statusLabel: FUILabel! { get } -
A status image displayed in the status view. Use
statusImageto set an image. It’s expected to either setstatusTextorstatusImageto display either one at the same position. When bothstatusTextandstatusImageare set, only the last property set gets displayed.Declaration
Swift
@IBOutlet @MainActor public private(set) var statusImageView: FUIImageView! { get } -
A substatus label displayed below
statusImageVieworstatusLabel. UsesubstatusLabelto set the label’s text value. It’s expected to either setsubstatusTextorsubstatusImageto display either one at the same position. When bothstatusTextandstatusImageare set, only the last property set gets displayed. 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.Declaration
Swift
@IBOutlet @MainActor public private(set) var substatusLabel: FUILabel! { get } -
A substatus image displayed below
statusImageVieworstatusLabel. UsesubstatusImageto set an image to the view. It’s expected to either setstubsatusTextorsubstatusImageto display either one at the same position. When bothsubstatusTextandsubstatusImageare set, only the last property set gets displayed. 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.Declaration
Swift
@IBOutlet @MainActor public private(set) var substatusImageView: FUIImageView! { get }
-
Array of images, to be rendered in
iconStackView. Count of visible images is limited, to the count of active labels in the main stack.Declaration
Swift
@IBInspectable @MainActor public var iconImages: [UIImage] { get set } -
Property to preserve
iconStackViewspacing. When it’s set totrue, spacing is preserved foriconStackVieweven when there are no icons/images added to the icon stackDeclaration
Swift
@IBInspectable @MainActor public var preserveIconStackSpacing: Bool { get set } -
Property to set image of
DetailImageViewDeclaration
Swift
@IBInspectable @MainActor public var detailImage: UIImage? { get set } -
Property to preserve
detailImageViewspacing. When it’s set to true, spacing is preserved fordetailImageVieweven when there’s no image added to the image view.Declaration
Swift
@IBInspectable @MainActor public var preserveDetailImageSpacing: Bool { get set } -
Text of
headlineLabelDeclaration
Swift
@IBInspectable @MainActor public var headlineText: String? { get set } -
Text of
subheadlineLabel. The label is initially hidden. Setting a non-empty value would no longer hide the label.Declaration
Swift
@IBInspectable @MainActor public var subheadlineText: String? { get set } -
Text of
footnoteLabel. The label is initially hidden. Setting a non-empty value would no longer hide the label.Declaration
Swift
@IBInspectable @MainActor public var footnoteText: String? { get set } -
Text of
descriptionLabel.Declaration
Swift
@IBInspectable @MainActor public var descriptionText: String? { get set } -
Text of
statusLabel. An empty string value hidesstatusLabel. It’s expected to either setstatusTextorstatusImageto display either one at the same position. When bothstatusTextandstatusImageare set, only the last property set gets displayed.Declaration
Swift
@IBInspectable @MainActor public var statusText: String? { get set } -
Image of status image view
Declaration
Swift
@IBInspectable @MainActor public var statusImage: UIImage? { get set } -
Text of substatus label.
Declaration
Swift
@IBInspectable @MainActor public var substatusText: String? { get set } -
Image of substatus image view.
Declaration
Swift
@IBInspectable @MainActor public var substatusImage: UIImage? { get set }
-
Default main stack right edge is set at midpoint of cell’s readable width, minus 8px. Set to fraction between 0.01 and 0.99, to move the right edge of the
mainStack, relative to the cell readable width.Important
the percentage of readable width includes areas often containing other subviews. So, a valid value is typically between 30% and 70%.
Only used when
horizontalSizeClassof the object cell is.regular.Declaration
Swift
@MainActor public var splitPercent: CGFloat { get set }