FUIObjectCollectionViewCell

FUIObjectCollectionViewCell is the default UICollectionView subclass 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.accessoryType = .disclosureIndicator

Remark

The labels’ numberOfLines property is supported, for limiting the number of lines of the text which will be displayed. If the text or attributedText includes 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 iconImages property which conform to the FUIGlyphImage protocol. These include: UIImage, FUIAttributedGlyphImage, and String. It is recommended when supplying image types, to ensure that the rendering mode is alwaysTemplate, 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 the iconsColumnWidth: CGFloat property, though this is generally discouraged, unless it is necessary to support multiple digits of a String type (for example: iconImages = ["24"] may require iconsColumnWidth = 20.0).

The preserveIconStackSpacing: Bool property may be used to ensure that the insertion point of the view to the right of the icons layout (detailImageView, or headlineLabel) 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 be directionalLayoutMargins.left.

AccessoryView and EditingAccessoryView

Standard UITableViewCell accessoryView, accessoryType are supported.

The actionAccessoryView is a specialized view that takes the place of the usual accessoryView. This view is a FUISingleActionAccessoryView that shows an interactable button or progressView. Changing the actionAccessoryType changes the view that is shown. By default, the actionAccessoryType is 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 CollectionViewCell class paths:

fdlFUIObjectCollectionViewCell {}

Supported CollectionViewCell attributes:

tint-color (Color)
background-color (Color)
background-color-selected (Color)

Supported Text class paths:

fdlFUIObjectCollectionViewCell_headlineLabel {}
fdlFUIObjectCollectionViewCell_subheadlineLabel {}
fdlFUIObjectCollectionViewCell_footnoteLabel {}
fdlFUIObjectCollectionViewCell_statusLabel {}
fdlFUIObjectCollectionViewCell_substatusLabel {}
fdlFUIObjectCollectionViewCell_descriptionLabel {}

Supported Text attributes:

font-color (Color)
font-name (FontName)
font-style (UIFontTextStyle)
font-size (Number)
text-align (TextAlign)
text-line-clamp (Integer)

Supported ImageView class paths:

fdlFUIObjectCollectionViewCell_detailImageView {}
fdlFUIObjectCollectionViewCell_statusImageView {}
fdlFUIObjectCollectionViewCell_substatusImageView {}

Supported ImageView attributes:

image-name (Image)
tint-color (Color)
  • Dimensions of detailImageView. Should be with range of CGSize(width: 32, height: 32) to CGSize(width: 60, height: 60). ‘Profile’ images should always be the default CGSize(width: 45, height: 45).

    Declaration

    Swift

    public var detailImageViewSize: CGSize { get set }
  • Horizontal dimension, where iconImages are laid out. Defaults to 12.0. In general, only adjust this value, if numeric values rendered in the column are too wide to fit the default.

    Declaration

    Swift

    public var iconsColumnWidth: CGFloat { get set }
  • Changes the FUISingleActionAccessoryView to show the corresponding FUITableViewCellActionAccessoryType. By default, the actionAccessoryType is set to none

    Declaration

    Swift

    open var actionAccessoryType: FUITableViewCellActionAccessoryType { get set }