Skip to content

Hierarchy Item Table View Cell

FUIHierarchyItemTableViewCell

open class FUIHierarchyItemTableViewCell: FUIObjectBaseTableViewCell<FUIHierarchyItemView>

FUIHierarchyItemTableViewCell is a table view UI component which extends FUIObjectBaseTableViewCell for showing a collection item's business object content and hierarchy information (e.g. number of children in its next level). It is identical to FUIHierarchyCollectionItem in terms of the configuration of inner view and hierarchy indicator.

Initialization and Configuration

To use FUIHierarchyItemTableViewCell, it should be dequeued from hierarchyView and returned in the data source method in FUIHierarchyViewDataSource.

Example of setting an FUIHierarchyCollectionItem in a table view:

   cell.title.text = "Business Object Title"
   cell.subtitle.text = "Business Object Subtitle"
   cell.footnote.text = "Business Object Footnote"
   cell.hierarchyIndicator.title.text = "128"
   cell.status.text = "Business Object Status"
   cell.accessoryType = .disclosureIndicator

Settings of Hierarchy Indicator

Similar to FUIHierarchyCollectionItem, hierarchy indicator is used to display related hierarchy information. To customize a different text in hierarchy indicator, set the text for title property of the cell's FUIHierarchyIndicator.

   cell.hierarchyIndicator.title.text = "My Title"

Likewise, hierarchy indicator by default is displayed in a vertical aligned multi-line mode in FUIHierarchyCollectionItem. To display in single-line mode, configure the isMultiline property of the cell's FUIHierarchyIndicator.

   cell.hierarchyIndicator.isMultiline = false

Layout of Hierarchy Indicator in Table View

The default width of the space showing hierarchy indicator is 38px in multi-line mode and 74px in multi-line mode. So the table view controller consuming the FUIHierarchyItemTableViewCell should enforce this minimum layout margin based on its display mode. The recommended technique for managing this is to set the table view controller's additionalSafeAreaInsets property accordingly.

override func viewDidLoad() {
   self.tableView.showsVerticalScrollIndicator = false
   self.tableView.insetsContentViewsToSafeArea = false
   if UIView.userInterfaceLayoutDirection(for: self.view.semanticContentAttribute) == .leftToRight {
       self.additionalSafeAreaInsets.right = 38
   } else {
       self.additionalSafeAreaInsets.left = 38
   }
}

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.

Customize Selection Behavior

Similar to FUIHierarchyCollectionItem, selection behavior can be customized by conforming to FUIHierarchyViewDelegate and then implementing the hierarchyButtonTappedForItemWith method.

AccessoryView, AccessoryType, and EditingAccessoryView

Standard UITableViewCell properties like accessoryView, accessoryType, and editingAccessoryView are supported.

Theming

Supported class paths:

   fdlFUIBaseCollectionViewCell {}
   fdlFUIBaseCollectionViewCell_title {}
   fdlFUIBaseCollectionViewCell_subtitle {}
   fdlFUIBaseCollectionViewCell_footnote {}
   fdlFUIBaseCollectionViewCell_detailImageView {}

Please refer to FUIHierarchyItemView and FUIHierarchyIndicator documentation for all supported attributes.


Last update: December 8, 2020