SwiftGridViewDataSource
@objc
public protocol SwiftGridViewDataSource
The SwiftGridViewDataSource
protocol is used much like a UICollectionView or UITableView data source for retrieving all data needed to display the data grid.
-
Count of sections to display in the data grid.
Declaration
Swift
func numberOfSectionsInDataGridView(_ dataGridView: SwiftGridView) -> Int
Parameters
dataGridView
The swift grid view instance.
Return Value
The number of sections within the data grid.
-
Count of columns to display in the data grid.
Declaration
Swift
func numberOfColumnsInDataGridView(_ dataGridView: SwiftGridView) -> Int
Parameters
dataGridView
The swift grid view instance.
Return Value
The number of columns within the data grid.
-
The grouping settings to use for the data grid. Expects an array of grouped column index sets for the first and last column index in each grouping. Columns cannot be included in multiple groupings. Example: [[1,4], [5,8]]
Declaration
Swift
@objc optional func columnGroupingsForDataGridView(_ dataGridView: SwiftGridView) -> [[Int]]
Parameters
dataGridView
The swift grid view instance.
Return Value
Array of grouped column index sets.
-
Number of rows to display in the provided data grid section.
Declaration
Swift
func dataGridView(_ dataGridView: SwiftGridView, numberOfRowsInSection section: Int) -> Int
Parameters
dataGridView
The swift grid view instance.
section
Current section index.
Return Value
The number of rows for the current section.
-
Number of frozen rows in the provided section. Frozen rows start from the top and will be “frozen” in place and not scroll vertically out of view.
Declaration
Swift
@objc optional func dataGridView(_ dataGridView: SwiftGridView, numberOfFrozenRowsInSection section: Int) -> Int
Parameters
dataGridView
The swift grid view instance.
Return Value
Count of frozen columns in the data grid.
-
Number of frozen columns in the data grid. Frozen columns start from the left and will be “frozen” in place and not scroll horizontally out of view.
Declaration
Swift
@objc optional func numberOfFrozenColumnsInDataGridView(_ dataGridView: SwiftGridView) -> Int
Parameters
dataGridView
The swift grid view instance.
Return Value
Count of frozen columns in the data grid.
-
Return the cell content to be displayed in the data grid for the provided indexPath.
- Paramter indexPath: The Swift Grid extended index path location of the cell.
Declaration
Swift
func dataGridView(_ dataGridView: SwiftGridView, cellAtIndexPath indexPath: IndexPath) -> SwiftGridCell
Parameters
dataGridView
The swift grid view instance.
Return Value
Cell that has been dequeued and of
SwiftGridCell
type. -
Return the header view to be displayed in the provided column.
Declaration
Swift
@objc optional func dataGridView(_ dataGridView: SwiftGridView, gridHeaderViewForColumn column: NSInteger) -> SwiftGridReusableView
Parameters
dataGridView
The swift grid view instance.
column
Current column index.
Return Value
View that has been dequeued and of
SwiftGridReusableView
type. -
Return the header view to be displayed in the provided column grouping
Declaration
Swift
@objc optional func dataGridView(_ dataGridView: SwiftGridView, groupedHeaderViewFor columnGrouping: [Int], at index: Int) -> SwiftGridReusableView
Parameters
dataGridView
The swift grid view instance.
columnGrouping
Current grouping.
index
Current grouping index.
Return Value
View that has been dequeued and of
SwiftGridReusableView
type. -
Number of sections to display in the data grid
Declaration
Swift
@objc optional func dataGridView(_ dataGridView: SwiftGridView, gridFooterViewForColumn column: NSInteger) -> SwiftGridReusableView
Parameters
dataGridView
The swift grid view instance.
column
Current column index.
Return Value
View that has been dequeued and of
SwiftGridReusableView
type. -
Number of sections to display in the data grid
Declaration
Swift
@objc optional func dataGridView(_ dataGridView: SwiftGridView, sectionHeaderCellAtIndexPath indexPath: IndexPath) -> SwiftGridReusableView
Parameters
dataGridView
The swift grid view instance.
indexPath
Current Swift Grid index path for the section header. Section and Column are provided values, Row is ignored.
Return Value
View that has been dequeued and of
SwiftGridReusableView
type. -
Number of sections to display in the data grid
Declaration
Swift
@objc optional func dataGridView(_ dataGridView: SwiftGridView, sectionFooterCellAtIndexPath indexPath: IndexPath) -> SwiftGridReusableView
Parameters
dataGridView
The swift grid view instance.
indexPath
Current Swift Grid index path for the section footer. Section and Column are provided values, Row is ignored.
Return Value
View that has been dequeued and of
SwiftGridReusableView
type.