FUIObjectCard
@MainActor
open class FUIObjectCard : FUIBaseAccessoryDrawingCollectionViewCell<FUIObjectCardContentView>, InnerViewContainerEventHandling, FUIContentCopyableView
FUIObjectCard is a collection view UI component which extends FUIBaseAccessoryDrawingCollectionViewCell for showing rich business information for an object in a card format, including tags and rating. The FUIObjectCard can also be configured to use single action button.
Initialization and Configuration:
To use FUIObjectCard, it should be dequeued from a UICollectionView and returned in its data source method.
Example of setting an FUIObjectCard by implementing cellForItemWith in the collection view:
cell.title.text = "Business Object Title"
cell.subtitle.text = "Business Object Subtitle"
cell.footnote.text = "Business Object Footnote"
cell.tags = [FUITag(title: "Tag - 1"), FUITag(title: "Tag - 2"), FUITag(title: "Tag - 3")]
cell.rating = 5
cell.trailingProperties = [.tags, .footnote, .rating]
cell.status.text = "$26.99"
cell.actionAccessoryType = .button
cell.actionAccessoryView?.button.setImage(FUIIconLibrary.system.cartAdd.withRenderingMode(.alwaysTemplate), for: .normal)
cell.actionAccessoryView?.button.contentMode = .center
Tags Compression Behavior:
Based on Fiori Global Design guidance, if the content size of tags component goes beyond one line, it will be truncated automatically to be fitted into one line display mode with a placeholder showing a title of “+x more” information (x means the number of remaining tags that are hidden). Please note that the compression will not work when the tag’s content is too long or only one tag is set.
Trailing Properties:
The order of trailing properties, including .tags, .footnote and .rating, can be set by the developer. By default, the trailing properties is set to [.footnote, .rating, .tags]. If there are duplicated trailing properties, only the first one will be displayed.
Default Styling:
Depending on the selection state, the tint color and button style of hierarchy icon, the font size of the title text, and the cell’s background color will be updated automatically.
Theming:
Supported class paths:
fdlFUIObjectCard {}
Please refer to FUIObjectCardContentView documentation for all supported attributes.
-
Display order for trailing attributed text components
Declaration
Swift
@MainActor public var trailingProperties: [FUIObjectCardContentView.OrderedPropertyRef] { get set } -
Rating value for
FUIRatingControlcomponentDeclaration
Swift
@MainActor public var rating: Int? { get set } -
Average rating value for
FUIRatingControlcomponentDeclaration
Swift
@MainActor public var averageRating: Float? { get set } -
Indicator to show leading label for
FUIRatingControlcomponentDeclaration
Swift
@MainActor public var showsRatingLeadingLabel: Bool { get set } -
Indicator to show trailing label for
FUIRatingControlcomponentDeclaration
Swift
@MainActor public var showsRatingTrailingLabel: Bool { get set } -
Review count for
FUIRatingControlcomponentDeclaration
Swift
@MainActor public var ratingReviewCount: Int? { get set } -
Review count ceiling for
FUIRatingControlcomponentDeclaration
Swift
@MainActor public var ratingReviewCountCeiling: Int? { get set } -
Leading label format for
FUIRatingControlcomponentDeclaration
Swift
@MainActor public var ratingLeadingLabelFormat: String? { get set } -
Trailing label format for
FUIRatingControlcomponentDeclaration
Swift
@MainActor public var ratingTrailingLabelFormat: String? { get set } -
Indicator to show rating with large size for
FUIRatingControlcomponentDeclaration
Swift
@MainActor public var isLargeRatingSize: Bool { get set } -
Declaration
Swift
@MainActor public var numberOfTagLines: Int { get set }