SwiftGridViewDelegate

@objc
public protocol SwiftGridViewDelegate

The SwiftGridViewDelegate protocol is used much like a UICollectionView or UITableView delegate for handling interactions and sizing of the data grid.

Sizing

  • Returns the width of the specified column in the data grid.

    Declaration

    Swift

    func dataGridView(_ dataGridView: SwiftGridView, widthOfColumnAtIndex columnIndex: Int) -> CGFloat

    Parameters

    dataGridView

    The swift grid view instance.

    columnIndex

    Current column index.

    Return Value

    Width to be used for all views and cells in the provided column.

  • Returns the height of the specified row in the data grid.

    Declaration

    Swift

    func dataGridView(_ dataGridView: SwiftGridView, heightOfRowAtIndexPath indexPath: IndexPath) -> CGFloat

    Parameters

    dataGridView

    The swift grid view instance.

    indexPath

    Current Swift Grid index path for the row. Section and Row are provided values, Column is ignored.

    Return Value

    Height to be used for all cells in the provided row.

Header Methods

  • Returns the height of the header views in the data grid.

    Declaration

    Swift

    @objc
    optional func heightForGridHeaderInDataGridView(_ dataGridView: SwiftGridView) -> CGFloat

    Parameters

    dataGridView

    The swift grid view instance.

    Return Value

    Height to be used for all views in the grid header.

  • Called when a header view is selected.

    Declaration

    Swift

    @objc
    optional func dataGridView(_ dataGridView: SwiftGridView, didSelectHeaderAtIndexPath indexPath: IndexPath)

    Parameters

    dataGridView

    The swift grid view instance.

    indexPath

    Current Swift Grid index path for the header. Column is the provided value, Row and Section are ignored.

  • Called when a header view is deselected.

    Declaration

    Swift

    @objc
    optional func dataGridView(_ dataGridView: SwiftGridView, didDeselectHeaderAtIndexPath indexPath: IndexPath)

    Parameters

    dataGridView

    The swift grid view instance.

    indexPath

    Current Swift Grid index path for the header. Column is the provided value, Row and Section are ignored.

  • Called when a grouped header view is selected.

    Declaration

    Swift

    @objc
    optional func dataGridView(_ dataGridView: SwiftGridView, didSelectGroupedHeader columnGrouping: [Int], at index: Int)

    Parameters

    dataGridView

    The swift grid view instance.

    index

    Grouped header index.

  • Called when a grouped header view is deselected.

    Declaration

    Swift

    @objc
    optional func dataGridView(_ dataGridView: SwiftGridView, didDeselectGroupedHeader columnGrouping: [Int], at index: Int)

    Parameters

    dataGridView

    The swift grid view instance.

    index

    Grouped header index.

Footer Methods

  • Returns the height of the footer views in the data grid.

    Declaration

    Swift

    @objc
    optional func heightForGridFooterInDataGridView(_ dataGridView: SwiftGridView) -> CGFloat

    Parameters

    dataGridView

    The swift grid view instance.

    Return Value

    Height to be used for all views in the grid footer.

  • Called when a footer view is deselected.

    Declaration

    Swift

    @objc
    optional func dataGridView(_ dataGridView: SwiftGridView, didSelectFooterAtIndexPath indexPath: IndexPath)

    Parameters

    dataGridView

    The swift grid view instance.

    indexPath

    Current Swift Grid index path for the footer. Column is the provided value, Row and Section are ignored.

  • Called when a footer view is deselected.

    Declaration

    Swift

    @objc
    optional func dataGridView(_ dataGridView: SwiftGridView, didDeselectFooterAtIndexPath indexPath: IndexPath)

    Parameters

    dataGridView

    The swift grid view instance.

    indexPath

    Current Swift Grid index path for the footer. Column is the provided value, Row and Section are ignored.

Section Header Methods

  • Returns the height of the header views in the provided data grid section.

    Declaration

    Swift

    @objc
    optional func dataGridView(_ dataGridView: SwiftGridView, heightOfHeaderInSection section: Int) -> CGFloat

    Parameters

    dataGridView

    The swift grid view instance.

    Return Value

    Height to be used for all views in the section’s header.

  • Called when a section header view is selected.

    Declaration

    Swift

    @objc
    optional func dataGridView(_ dataGridView: SwiftGridView, didSelectSectionHeaderAtIndexPath indexPath: IndexPath)

    Parameters

    dataGridView

    The swift grid view instance.

    indexPath

    Current Swift Grid index path for the section header. Section and Column are provided, Row is ignored.

  • Called when a section header view is deselected.

    Declaration

    Swift

    @objc
    optional func dataGridView(_ dataGridView: SwiftGridView, didDeselectSectionHeaderAtIndexPath indexPath: IndexPath)

    Parameters

    dataGridView

    The swift grid view instance.

    indexPath

    Current Swift Grid index path for the section header. Section and Column are provided, Row is ignored.

Section Footer Methods

  • Returns the height of the footer views in the provided data grid section.

    Declaration

    Swift

    @objc
    optional func dataGridView(_ dataGridView: SwiftGridView, heightOfFooterInSection section: Int) -> CGFloat

    Parameters

    dataGridView

    The swift grid view instance.

    Return Value

    Height to be used for all views in the section’s footer.

  • Called when a section footer view is selected.

    Declaration

    Swift

    @objc
    optional func dataGridView(_ dataGridView: SwiftGridView, didSelectSectionFooterAtIndexPath indexPath: IndexPath)

    Parameters

    dataGridView

    The swift grid view instance.

    indexPath

    Current Swift Grid index path for the section footer. Section and Column are provided, Row is ignored.

  • Called when a section footer view is deselected.

    Declaration

    Swift

    @objc
    optional func dataGridView(_ dataGridView: SwiftGridView, didDeselectSectionFooterAtIndexPath indexPath: IndexPath)

    Parameters

    dataGridView

    The swift grid view instance.

    indexPath

    Current Swift Grid index path for the section footer. Section and Column are provided, Row is ignored.

Cell Methods