FUIDataTable

open class FUIDataTable : UIView

A FUIDataTable is a view that displaying data in either a list view or a grid table view.

Code usage:

let model = FUIDataTableModel(headerData: nil,
                              rowData: rowData,
                              isHeaderSticky: true,
                              isFirstColumnSticky: true,
                              columnAttributes: columnAttributes,
                              rowAlignment: .top,
                              isPinchZoomEnable: false,
                              showRowDivider: true,
                              showColoumnDivider: true,
                              headerCellPadding: UIEdgeInsets(top: 8, left: 16, bottom: 8, right: 16),
                              dataCellPadding: UIEdgeInsets(top: 16, left: 16, bottom: 16, right: 16),
                              minRowHeight: 48,
                              minColumnWidth: 48,
                              allowsPartialRowDisplay: true,
                              backgroundColor: .white,
                              showListView: false)
model.didSelectRowAt = { _ in
    print(model.selectedIndexes)
}
let dataTable = FUIDataTable(model: model)

Theming

Supported TEXT class paths:

fdlFUIDataTable_textItem {}: TEXT theme for all cells. It has lowest priority.
fdlFUIDataTable_textItem_row2 {}: TEXT theme for one speciif column. # is the column index. It has third priority.
fdlFUIDataTable_textItem_column1 {}: TEXT theme for one specific row. # is the row index; header is row 0 if it existis. It has second priority.
fdlFUIDataTable_textItem_row2_column1{}: TEXT theme for one specific cell. Row index and column index are required. It has highest priority.

Supported TEXT properties:

font-color: Color;
font-style: UIFontTextStyle;
text-line-clamp: Integer;
text-align: NSTextAlignment;

Supported IMAGE class paths:

fdlFUIDataTable_imageItem {}: IMAGE theme for all cells. It has lowest priority.
fdlFUIDataTable_imageItem_column# {}: IMAGE theme for one speciif column. # is the column index. It has third priority.
fdlFUIDataTable_imageItem_row# {}: IMAGE theme for one specific row. # is the row index; header is row 0 if it existis. It has second priority.
fdlFUIDataTable_imageItem_row#_column# {}: IMAGE theme for one specific cell. Row index and column index are required. It has highest priority.

Supported IMAGE properties:

tint-color: Color;
image-name: String;
  • Data table’s data model.

    Declaration

    Swift

    public var model: FUIDataTableModel!
  • Boolean for switching the data table in normal and editing mode.

    Declaration

    Swift

    public var isEditing: Bool { get set }
  • Setting background color for data table.

    Declaration

    Swift

    public var dataTableBackgroundColor: UIColor? { get set }
  • Set header to be sticky or not.

    Declaration

    Swift

    public var isHeaderSticky: Bool { get set }
  • Set first column to be sticky or not.

    Declaration

    Swift

    public var isFirstColumnSticky: Bool { get set }
  • Set pinch and zoom enble or not.

    Declaration

    Swift

    public var isPinchZoomEnable: Bool { get set }
  • Show list view or not

    Declaration

    Swift

    public func showListView(_ value: Bool)
  • Show or hide column divider.

    Declaration

    Swift

    public func showColumnDivider(_ value: Bool)

    Parameters

    value

    true to show; false to hide

  • Show or hide row divider.

    Declaration

    Swift

    public func showRowDivider(_ value: Bool)

    Parameters

    value

    true to show; false to hide

  • Pads all header cells of this DataTable using the edges and padding amount you specify.

    Declaration

    Swift

    public func headerCellPadding(_ value: UIEdgeInsets?)

    Parameters

    insets

    The edges and amounts to inset.

  • Pads all cells of this DataTable using the edges and padding amount you specify.

    Declaration

    Swift

    public func dataCellPadding(_ value: UIEdgeInsets?)

    Parameters

    insets

    The edges and amounts to inset.

  • Set minimum row height

    Declaration

    Swift

    public func minRowHeight(_ value: CGFloat)
  • Set minimum column width

    Declaration

    Swift

    public func minColumnWidth(_ value: CGFloat)
  • Set whether to allow partial row display

    Declaration

    Swift

    public func allowsPartialRowDisplay(_ value: Bool)
  • Set row alignment mode

    Declaration

    Swift

    public func rowAlignment(_ value: FUIDataTableRowAlignment)
  • Public initializer for FUIDataTable.

    Declaration

    Swift

    public init(model: FUIDataTableModel)

    Parameters

    model
  • Undocumented

    Declaration

    Swift

    required public init?(coder: NSCoder)