GridViewDelegate

public protocol GridViewDelegate : AnyObject

An object capable of handing GridView events

  • Invoked when EditorView within the cell receives focus

    Declaration

    Swift

    func gridView(_ gridView: GridView, didReceiveFocusAt range: NSRange, in cell: GridCell)

    Parameters

    gridView

    GridView containing cell

    range

    Range of content in the EditorView within the Cell

    cell

    Cell containing Editor

  • Invoked when EditorView within the cell loses focus

    Declaration

    Swift

    func gridView(_ gridView: GridView, didLoseFocusFrom range: NSRange, in cell: GridCell)

    Parameters

    gridView

    GridView containing cell

    range

    Range of content in the EditorView within the Cell

    cell

    Cell containing Editor

  • Invoked when tap event occurs within the Editor contained in the cell.

    Declaration

    Swift

    func gridView(_ gridView: GridView, didTapAtLocation location: CGPoint, characterRange: NSRange?, in cell: GridCell)

    Parameters

    gridView

    GridView containing cell

    location

    Tapped location

    characterRange

    Range of characters in the Editor at the tapped location

    cell

    Cell containing Editor

  • Invoked on selection changes with in the Editor contained in the cell.

    Declaration

    Swift

    func gridView(_ gridView: GridView, didChangeSelectionAt range: NSRange, attributes: [NSAttributedString.Key : Any], contentType: EditorContent.Name, in cell: GridCell)

    Parameters

    gridView

    GridView containing cell

    range

    Range of selection in the EditorView within the Cell

    attributes

    Attributes at selected range

    contentType

    ContentType at selected range

    cell

    Cell containing Editor

  • Invoked on change of bounds of the Editor within the cell

    Declaration

    Swift

    func gridView(_ gridView: GridView, didChangeBounds bounds: CGRect, in cell: GridCell)

    Parameters

    gridView

    GridView containing cell

    bounds

    Bounds of the EditorView within the cell. Height of EditorView may be less than that of the Cell.

    cell

    Cell containing Editor

  • Invoked when selection of cells is changed.

    Declaration

    Swift

    func gridView(_ gridView: GridView, didSelectCells cells: [GridCell])

    Parameters

    gridView

    GridView containing cell

    cells

    Selected cells

  • Invoked when selection of cells is changed.

    Declaration

    Swift

    func gridView(_ gridView: GridView, didUnselectCells cells: [GridCell])

    Parameters

    gridView

    GridView containing cell

    cells

    Cells that are changed from selected to unselected.

  • Invoked when special keys are intercepted in the Editor contained in the cell.

    Declaration

    Swift

    func gridView(_ gridView: GridView, didReceiveKey key: EditorKey, at range: NSRange, in cell: GridCell)

    Parameters

    gridView

    GridView containing cell

    key

    Special key

    range

    Range at with the key is intercepted.

    cell

    Cell containing Editor

  • Invoked when a column in GridView is resized.

    Declaration

    Swift

    func gridView(_ gridView: GridView, shouldChangeColumnWidth proposedWidth: CGFloat, for columnIndex: Int) -> Bool

    Parameters

    gridView

    GridView containing column

    proposedWidth

    Proposed column width before the change

    columnIndex

    Index of column being resized

    Return Value

    true if column resizing should be allowed, else false.

  • Notifies when GridView lays out a cell. This is called after the bounds calculation for the cell have been performed. Rendering of cell may not have been completed at this time.

    Declaration

    Swift

    func gridView(_ gridView: GridView, didLayoutCell cell: GridCell)

    Parameters

    gridView

    GridView containing the cell.

    cell

    Cell being laid out