From 8b77b9e78a67c25cec2d9458e25aae9c6ea5e865 Mon Sep 17 00:00:00 2001 From: Rajdeep Kwatra Date: Mon, 11 Dec 2023 17:40:05 +1100 Subject: [PATCH] Added ability to detect if cell editor is initialized and a callback for the same --- Proton/Sources/Swift/Grid/View/GridCell.swift | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Proton/Sources/Swift/Grid/View/GridCell.swift b/Proton/Sources/Swift/Grid/View/GridCell.swift index 92e81ca0..a312fcd7 100644 --- a/Proton/Sources/Swift/Grid/View/GridCell.swift +++ b/Proton/Sources/Swift/Grid/View/GridCell.swift @@ -151,6 +151,14 @@ open class GridCell { /// Controls if the cell can be selected or not. public var isSelectable: Bool = true + /// Invoked when Editor in contained in the Cell is initialized. Only applicable when deferred `editorInitializer` is passed in `init`. + public var onEditorInitialized: ((GridCell, EditorView) -> Void)? + + /// Confirms if Editor within Cell has been initialized or not. Only applicable when deferred `editorInitializer` is passed in `init`. + public var isEditorInitialized: Bool { + _editor != nil + } + private(set) var editorSetupComplete = false private var _editor: EditorView? /// Editor within the cell @@ -161,6 +169,7 @@ open class GridCell { return _editor } let editor = editorInitializer() + onEditorInitialized?(self, editor) _editor = editor return editor }