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
: aUIStackView
view expected to contain a vertical stack of icons/images in its view content. The view is added to the cell unlesscell.preserveIconStackSpacing
is set tofalse
. This is the first view in the cell and can be left todetailImageView
. Usecell.iconImages
to add image(s) to the stack view. Each icon/image size is set to be16px
by16px
. -
detailImageView
: anFUIImageView
view added to the cell unlesscell.preserveDetailImageSpacing
is set tofalse
. The view is to the right oficonsStackView
and left ofheadlineLabel
. The image is scaled to fit with fixed aspect. The image size is set to45px
by45px
. Usecell.detailImage
to set the image. -
headlineLabel
: aUILabel
view is always displayed and intended to display a headline text in the cell. Usecell.headlineText
to set label text. -
subheadlineLabel
: aUILabel
view is added3px
belowheadlineLabel
to the cell. Use `cell.subheadlineText" to set label text. -
footnoteLabel
: aUILabel
view is added3px
belowsubheadLabel
to the cell. Usecell.footnoteText
to set label text. -
descriptionLabel
: aUILabel
view intended to display long text in the cell. It gets displayed only in regular view. The view is to the right ofheadlineLabel
and left ofstatusImageView
(orstatusLabel
). Use `cell.descriptionText" to set label text. -
statusImageView
/statusLabel
: aUIImageView
/UILabel
added to the cell for status.statusImageView
gets added with size16px
by16px
. The view is to the left of accessory view and right ofdescriptionLabel
. Usecell.statusText
to set label text orcell.statusImage
to set image. -
substatusImageView
/substatusLabel
: aUIImageView
/UILabel
added to the cell under status.substatusImageView
gets added with size16px
by16px
. Usecell.substatusText
to set label text orcell.substatusImage
to set image. An error will be logged whenaccessoryType
is not.none
nor.disclosureIndicator
, then setting a substatus label text or substatus image as this setting breaks the Fiori Design Language pattern. -
accessoryView
: aUIView
added to the view whencell.accessoryType
is not.none
. The view is aUIButton
customized inFUIObjectCell
and is aligned to the baseline ofheadlineLabel
when 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