FUIObjectCollectionViewCell
open class FUIObjectCollectionViewCell : NibDesignableFUIBaseCollectionViewCell
FUIObjectCollectionViewCell
is an Interface-Builder-designable UI component that extends UICollectionViewCell
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.
Views Available in FUIObjectCollectionViewCell:
iconsStackView
: an UIStackView 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
: a FUIImageView view added to the cell unlesscell.preserveDetailImageSpacing
is set tofalse
. The view is right toiconsStackView
and left toheadlineLabel
. The image is scaled to fit with fixed aspect. The image size is set to45px
by45px
. Usecell.detailImage
to set imageheadlineLabel
: an UILabel view is always displayed and intended to display a heandline text in the cell. Usecell.headlineText
to set label textsubheadlineLabel
: an UILabel view is added 3px belowheadlineLabel
to the cell. Use `cell.subheadlineText" to set label textfootnoteLabel
: an UILabel view is added 3px belowsubheadLabel
to the cell. Use `cell.footnoteText" to set label textstatusImageView
/statusLabel
: an UIImageView/UILabel added to the cell for status.statusImageView
gets added with size16px
by16px
. The view is left to accessory view and right todescriptionLabel
. Usecell.statusText
to set label text orcell.statusImage
to set image.substatusImageView
/substatusLabel
: an UIImageView/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 Fiori Design Language pattern.accessoryView
: an UIView added to the view whencell.accessoryType
is not.none
. The view is an UIButton customized in FUIObjectCell and is aligned to the base-line 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:
public func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: FUIObjectCollectionViewCell.reuseIdentifier, for: indexPath) as! FUIObjectCollectionViewCell
cell.headlineText = "Issues: \(issues[indexPath.row])"
cell.subheadlineText = "Available on Jan 31st"
cell.footnoteText = "Delivered by San Ramon team, from the new Office Space"
cell.statusText = "Available"
cell.substatusImage = #imageLiteral(resourceName: "ErrorIcon")
cell.substatusImageView.tintColor = UIColor.preferredFioriColor(forStyle: .negative)
return cell
}
-
Icons Stack view that contains a stack of icons/images in its contents. Each icon/image size is set to be
16px
by16px
. Count of visible images is limited, to the count of active labels in the main stackDeclaration
Swift
public var iconsStackView: UIStackView { get }
-
Detail image view that contains an image with size of 45px x 45px
Declaration
Swift
public var detailImageView: FUIImageView { get }
-
A headline label in the main view with UIFontTextStyleHeadline style setting as the preferred font. Use
headlineText
to set the label’s text valueDeclaration
Swift
public var headlineLabel: FUILabel { get }
-
A sub-header label in the main view with UIFontTextStyleBody style setting as the preferred font. Use
subheadlineText
to set the label’s text valueDeclaration
Swift
public var subheadlineLabel: FUILabel { get }
-
A footnote label in the main view with UIFontTextStyleSubheadline style setting as the preferred font. Use
footnoteText
to set the label’s text valueDeclaration
Swift
public var footnoteLabel: FUILabel { get }
-
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
public var statusLabel: FUILabel { get }
-
A status image displayed in the status view. Use
stuatsImage
to set an image. It’s expected to either setstatusText
orstatusImage
to display either one as the same position. When bothstatusText
andstatusImage
are set, the last property set gets displayed only.Declaration
Swift
public var statusImageView: FUIImageView { get }
-
A substatus label displayed below
statusImageView
orstatusLabel
. UsesubstatusLabel
to set the label’s text value. It’s expected to either setsubstatusText
orsubstatusImage
to display either one as the same position. When bothstatusText
andstatusImage
are set, the last property set gets displayed only. WhenaccessoryType
is not.none
nor.disclosureIndicator
, setting substatus label text throws an assertion failure as this setting breaks Fiori Design Language pattern.Declaration
Swift
public var substatusLabel: FUILabel { get }
-
A substatus image displayed below
statusImageView
orstatusLabel
. UsesubstatusImage
to set an image to the view. It’s expected to either setstubsatusText
orsubstatusImage
to display either one as the same position. When bothsubstatusText
andsubstatusImage
are set, the last property set gets displayed only. WhenaccessoryType
is not.none
nor.disclosureIndicator
, setting a substatus image throws an assertion failure as this setting breaks Fiori Design Language pattern.Declaration
Swift
public var substatusImageView: FUIImageView { get }
-
Text of
headlineLabel
Declaration
Swift
@IBInspectable 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 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 public var footnoteText: String? { get set }
-
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 public var iconImages: Array<UIImage> { get set }
-
Property to set image of
DetailImageView
Declaration
Swift
@IBInspectable public var detailImage: UIImage? { get set }
-
Property to preserve
iconStackView
spacing. When it’s set totrue
, spacing is preserved foriconStackView
even when there’s no icons/images added to the icon stackDeclaration
Swift
@IBInspectable public var preserveIconStackSpacing: Bool { get set }
-
Property to preserve
detailImageView
spacing. When it’s set to true, spacing is preserved fordetailImageView
even when there’s no image added to the image viewDeclaration
Swift
@IBInspectable public var preserveDetailImageSpacing: Bool { get set }
-
Text of
statusLabel
. An empty string value hidesstatusLabel
. It’s expected to either setstatusText
orstatusImage
to display either one as the same position. When bothstatusText
andstatusImage
are set, the last property set gets displayed only.Declaration
Swift
@IBInspectable public var statusText: String? { get set }
-
Image of status image view
Declaration
Swift
@IBInspectable public var statusImage: UIImage? { get set }
-
Text of substatus label.
Declaration
Swift
@IBInspectable public var substatusText: String? { get set }
-
Image of substatus image view.
Declaration
Swift
@IBInspectable 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 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
public var splitPercent: CGFloat { get set }
-
Undocumented
Declaration
Swift
open private(set) var actionAccessoryView: FUISingleActionAccessoryView? { get set }
-
Undocumented
Declaration
Swift
open var actionAccessoryType: FUITableViewCellActionAccessoryType { get set }