Object Cell¶
FUIObjectCell¶
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