FUIObjectTableViewCell

open class FUIObjectTableViewCell: NibDesignableTableViewCell

FUIObjectTableViewCell is an Interface-Builder-designable UI component that extends UITableViewCell for showing information of an object. 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.

FUIObjectTableViewCell

Views Available in FUIObjectTableViewCell:

  • iconsStackView: an UIStackView view expected to contain a vertical stack of icons/images in its view content. The view is added to the cell unless cell.preserveIconStackSpacing is set to false. This is the first view in the cell and can be left to detailImageView. Use cell.iconImages to add image(s) to the stack view. Each icon/image size is set to be 16px by 16px.

  • detailImageView: a FUIImageView view added to the cell unless cell.preserveDetailImageSpacing is set to false. The view is right to iconsStackView and left to headlineLabel. The image is scaled to fit with fixed aspect. The image size is set to 45px by 45px. Use cell.detailImage to set image

  • headlineLabel: an UILabel view is always displayed and intended to display a heandline text in the cell. Use cell.headlineText to set label text

  • subheadlineLabel: an UILabel view is added 3px below headlineLabel to the cell. Use `cell.subheadlineText" to set label text

  • footnoteLabel: an UILabel view is added 3px below subheadLabel to the cell. Use `cell.footnoteText" to set label text

  • descriptionLabel: an UILabel view tended to display a long text in the cell. It gets displayed only in regular view. The view is right to headlineLabel and left to statusImageView(or statusLabel). Use `cell.descriptionText" to set label text

  • statusImageView/statusLabel: an UIImageView/UILabel added to the cell for status. statusImageView gets added with size 16px by 16px. The view is left to accessory view and right to descriptionLabel. Use cell.statusText to set label text or cell.statusImage to set image.

  • substatusImageView/substatusLabel: an UIImageView/UILabel added to the cell under status. substatusImageView gets added with size 16px by 16px. Use cell.substatusText to set label text or cell.substatusImage to set image. An error will be logged when accessoryType is not .none nor .disclosureIndicator, then setting a substatus label text or substatus image as this setting breaks Fiori Design Language pattern.

  • accessoryView: an UIView added to the view when cell.accessoryType is not .none. The view is an UIButton customized in FUIObjectCell and is aligned to the base-line of headlineLabel 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: FUIObjectTableViewCell.reuseIdentifier, for: indexPath as IndexPath) as! FUIObjectTableViewCell
cell.detailImage = UIImage(named: ProfilePic)
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
}

  • Reuse identifier @return String a reuse identifier that describes FUIObjectTableViewCell

    Declaration

    Swift

    open static var reuseIdentifier: String
  • Icons Stack view that contains a stack of icons/images in its contents. Each icon/image size is set to be 16px by 16px. Count of visible images is limited, to the count of active labels in the main stack

    Declaration

    Swift

    open var iconsStackView: UIStackView
  • Detail image view that contains an image with size of 45px x 45px

    Declaration

    Swift

    open var detailImageView: FUIImageView
  • A headline label in the main view with UIFontTextStyleHeadline style setting as the preferred font. Use headlineText to set the label’s text value

    Declaration

    Swift

    open var headlineLabel: FUILabel
  • A sub-header label in the main view with UIFontTextStyleBody style setting as the preferred font. Use subheadlineText to set the label’s text value

    Declaration

    Swift

    open var subheadlineLabel: FUILabel
  • A footnote label in the main view with UIFontTextStyleSubheadline style setting as the preferred font. Use footnoteText to set the label’s text value

    Declaration

    Swift

    open var footnoteLabel: FUILabel
  • A description label displayed in the description view when size class is .regular. Use descriptionText to set the label’s text value

    Declaration

    Swift

    open var descriptionLabel: FUILabel
  • A status label displayed in the status view. Use statusText to set the label’s text value. Status Label and status image can not co-exist in display. When both are set, the last one set gets displayed only.

    Declaration

    Swift

    open var statusLabel: FUILabel
  • A status image displayed in the status view. Use stuatsImage to set an image. It’s expected to either set statusText or statusImage to display either one as the same position. When both statusText and statusImage are set, the last property set gets displayed only.

    Declaration

    Swift

    open var statusImageView: FUIImageView
  • A substatus label displayed below statusImageView or statusLabel. Use substatusLabel to set the label’s text value. It’s expected to either set substatusText or substatusImage to display either one as the same position. When both statusText and statusImage are set, the last property set gets displayed only. When accessoryType is not .none nor .disclosureIndicator, setting substatus label text throws an assertion failure as this setting breaks Fiori Design Language pattern.

    Declaration

    Swift

    open var substatusLabel: FUILabel
  • A substatus image displayed below statusImageView or statusLabel. Use substatusImage to set an image to the view. It’s expected to either set stubsatusText or substatusImage to display either one as the same position. When both substatusText and substatusImage are set, the last property set gets displayed only. When accessoryType is not .none nor .disclosureIndicator, setting a substatus image throws an assertion failure as this setting breaks Fiori Design Language pattern.

    Declaration

    Swift

    open var substatusImageView: FUIImageView
  • Text of headlineLabel

    Declaration

    Swift

    open var headlineText: String?
  • Text of subheadlineLabel. The label is initially hidden. Setting a non-empty value would no longer hide the label.

    Declaration

    Swift

    open var subheadlineText: String?
  • Text of footnoteLabel. The label is initially hidden. Setting a non-empty value would no longer hide the label.

    Declaration

    Swift

    open var footnoteText: String?
  • Text of descriptionLabel.

    Declaration

    Swift

    open var descriptionText: String?
  • 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

    open var iconImages: Array<UIImage>
  • Property to set image of DetailImageView

    Declaration

    Swift

    open var detailImage: UIImage?
  • Property to preserve iconStackView spacing. When it’s set to true, spacing is preserved for iconStackView even when there’s no icons/images added to the icon stack

    Declaration

    Swift

    open var preserveIconStackSpacing: Bool
  • Property to preserve detailImageView spacing. When it’s set to true, spacing is preserved for detailImageView even when there’s no image added to the image view

    Declaration

    Swift

    open var preserveDetailImageSpacing: Bool
  • Text of statusLabel. An empty string value hides statusLabel. It’s expected to either set statusText or statusImage to display either one as the same position. When both statusText and statusImage are set, the last property set gets displayed only.

    Declaration

    Swift

    open var statusText: String?
  • Image of status image view

    Declaration

    Swift

    open var statusImage: UIImage?
  • Text of substatus label.

    Declaration

    Swift

    open var substatusText: String?
  • Image of substatus image view.

    Declaration

    Swift

    open var substatusImage: UIImage?
  • Type of the accessory view

    Declaration

    Swift

    override open var accessoryType: UITableViewCellAccessoryType
  • 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 area often containing other subviews. So, a valid value is typically between 30% and 70%.

    Only used when horizontalSizeClass of the object cell is .regular.

    Declaration

    Swift

    open var splitPercent: CGFloat