FUIBaseTableViewCell

open class FUIBaseTableViewCell : UITableViewCell, FUIViewBorderDrawing
extension FUIBaseTableViewCell: FUIStateSelectable, FUIStateTintable

A UITableViewCell subclass, which supports limited configuration of separator line visibility and tintColor configuration.

Theming

Supported style classes

fdlFUIBaseTableViewCell
fdlFUIBaseTableViewCell_selectedBackgroundView
  • Indicates whether a tap action will result in a persistent cell selection background, or a momentary highlight.

    Important

    does not affect the behavior of isSelected

    Declaration

    Swift

    public var isMomentarySelection: Bool
  • Extension to UITableViewCell to support UIControlState-like configuration, with FUIStateSelectable.

    Important

    The default of this implementation does nothing.

    Declaration

    Swift

    public var isEnabled: Bool
  • Workaround for the compile issue where empty initializer is not accessible in xcframework.

    Declaration

    Swift

    required public init()
  • The set of edges of the view, which should display a separator line. This property is designed to manage cell separators only at the beginning or end of a section. For all other separator lines, you should use UITableView.separatorStyle, or UITableView.separatorInset, to configure visibility.

    Defaults to .all.

    Important

    Only top and bottom edges support separator lines. Options .left and .right will be ignored.
    override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        let cell = tableView.dequeueReusableCell(withIdentifier: FUIObjectTableViewCell.reuseIdentifier, for: indexPath as IndexPath) as! FUIObjectTableViewCell
    
        if indexPath.row == 0 { cell.separators = .bottom }
        if indexPath.row == tableView.numberOfRows(inSection: indexPath.section) - 1 { cell.separators = .top }
        // or
        if tableView.numberOfRows(inSection: indexPath.section) == 1 { cell.separators = [] }
    

    Declaration

    Swift

    @available(*, deprecated, message: "The cell `separators` override API has been disabled, to ensure there are no violations of Apple AppStore policy. The Fiori Design Guidelines for cell separators have been updated.  Please use `.line` preferred Fiori color for cell separator line, and `.backgroundBase` for table view background.")
    public var separators: UIRectEdge
  • Override this method to update appearance of the component according to state change. Default implementation does nothing. You can call tintColor(forState:) to get the tintColor for a state.

    Declaration

    Swift

    open func applyTintColor(forState state: UIControlState)

    Parameters

    state

    state for which apply tintColor.

  • Public setter to set tint color for state.

    Declaration

    Swift

    @available(*, deprecated, message: "No longer supported. Set textColor and tintColor programmatically.")
    public func setTintColor(_ color: UIColor, for state: UIControlState)

    Parameters

    color

    color needed for a state.

    state

    state for which tintColor is needed

  • Should be invoked by controls, when state is changed. Technique for doing this may vary. Controls are responsible for invoking correclty.

    Declaration

    Swift

    public func stateDidChange()
  • Public getter to read tint color from backing dictionary

    Declaration

    Swift

    public func tintColor(for state: UIControlState) -> UIColor?

    Parameters

    state

    state for which tintColor is needed

    Return Value

    if not .normal state, reads from backing dictionary. If .normal, returns self.tintColor. (This solves the issue, where an unset tintColor should return color from super.

  • The set of edges of the view, which should display a separator line.

    Defaults to .none.

    Important

    Only top and bottom edges support separator lines. Options .left and .right will be ignored.
    view.borders = .top
    

    Declaration

    Swift

    open var borders: UIRectEdge { get set }