GridCell
open class GridCell
extension GridCell: BoundsObserving
extension GridCell: EditorViewDelegate
extension GridCell: Equatable
extension GridCell: Hashable
Denotes a cell in the GridView
-
Undocumented
Declaration
Swift
public typealias EditorInitializer = () -> EditorView -
Additional attributes that can be stored on Cell to identify various aspects like Header, Numbered etc.
Declaration
Swift
public var additionalAttributes: [String : Any] -
Row indexes spanned by the cell. In case of a merged cell, this will contain all the rows= indexes which are merged.
Declaration
Swift
public internal(set) var rowSpan: [Int] { get } -
Column indexes spanned by the cell. In case of a merged cell, this will contain all the column indexes which are merged.
Declaration
Swift
public internal(set) var columnSpan: [Int] { get } -
Frame of the cell within
GridViewDeclaration
Swift
public internal(set) var frame: CGRect { get } -
Undocumented
Declaration
Swift
public var backgroundColor: UIColor? { get set } -
Sets the cell selected
Declaration
Swift
public var isSelected: Bool { get set } -
Controls if the cell can be selected or not.
Declaration
Swift
public var isSelectable: Bool -
Invoked when Editor in contained in the Cell is initialized.
Declaration
Swift
public var onEditorInitialized: ((GridCell, EditorView) -> Void)? -
Confirms if Editor within Cell has been initialized or not.
Declaration
Swift
public var isEditorInitialized: Bool { get } -
Editor within the cell
Declaration
Swift
public var editor: EditorView { get } -
Denotes if the cell can be split i.e. is a merged cell.
Declaration
Swift
public var isSplittable: Bool { get } -
Content size of the cell
Declaration
Swift
public var contentSize: CGSize { get } -
Content view for the cell
Declaration
Swift
public let contentView: UIView -
Undocumented
Declaration
Swift
public let gridStyle: GridStyle -
Undocumented
Declaration
Swift
public let style: GridCellStyle -
Undocumented
Declaration
Swift
public let ignoresOptimizedInit: Bool -
Initializes the cell
Important
Creating aGridViewwith 100s of cells can result in slow performance when creating an attributed string containing the GridView attachment. Using the closure defers the creation until the view is ready to be rendered in the UI. It is recommended to setup all the parts of editor in closure where possible, or wait until after the GridView is rendered. In case, editor must be initialized before the rendering is complete and it is not possible to configure an aspect within the closure itself,setupEditor()may be invoked. Use ofsetupEditor()is discouraged.Declaration
Swift
public init(rowSpan: [Int], columnSpan: [Int], initialHeight: CGFloat = 40, style: GridCellStyle = .init(), gridStyle: GridStyle = .default, ignoresOptimizedInit: Bool = false, editorInitializer: EditorInitializer? = nil)Parameters
rowSpanArray of row indexes the cells spans. For e.g. a cell with first two rows as merged, will have a value of [0, 1] denoting 0th and 1st index.
columnSpanArray of column indexes the cells spans. For e.g. a cell with first two columns as merged, will have a value of [0, 1] denoting 0th and 1st index.
initialHeightInitial height of the cell. This will be updated based on size of editor content on load,
styleVisual style of the cell
gridStyleVisual style for grid containing cell border color and width
ignoresOptimizedInitIgnores optimization to initialize editor within the cell. With optimization, the editor is not initialized until the cell is ready to be rendered on the UI thereby not incurring any overheads when creating attributedText containing a
GridViewin an attachment. Defaults tofalse.editorInitializerClosure for setting up the
EditorViewwithin the cell. -
Sets the focus in the
Editorwithin the cell.Declaration
Swift
public func setFocus() -
Removes the focus from the
Editorwithin the cell.Declaration
Swift
public func removeFocus() -
Applies the given style to the cell
Declaration
Swift
public func applyStyle(_ style: GridCellStyle)Parameters
styleStyle to apply
-
Declaration
Swift
public func didChangeBounds(_ bounds: CGRect, oldBounds: CGRect) -
Declaration
Swift
public func editor(_ editor: EditorView, didReceiveFocusAt range: NSRange) -
Declaration
Swift
public func editor(_ editor: EditorView, didLoseFocusFrom range: NSRange) -
Declaration
Swift
public func editor(_ editor: EditorView, didTapAtLocation location: CGPoint, characterRange: NSRange?) -
Declaration
Swift
public func editor(_ editor: EditorView, didChangeSelectionAt range: NSRange, attributes: [NSAttributedString.Key : Any], contentType: EditorContent.Name) -
Declaration
Swift
public func editor(_ editor: EditorView, didReceiveKey key: EditorKey, at range: NSRange) -
Undocumented
Declaration
Swift
public func editor(_ editor: EditorView, didChangeBackgroundColor color: UIColor?, oldColor: UIColor?) -
Declaration
Swift
public static func == (lhs: GridCell, rhs: GridCell) -> Bool -
Declaration
Swift
public func hash(into hasher: inout Hasher)
View on GitHub
GridCell Class Reference