EditorViewContext
public class EditorViewContext
Describes the context for the EditorView. A context is used to execute the commands using EditorCommandExecutor. In a typical scenario, where there are
multiple levels of EditorViews that are contained in another EditorView by virtue of being in Attachments, all the EditorViews sharing the same
context automatically share the EditorCommandExecutor. i.e. the EditorCommandExecutor operates on only those EditorViews which have the same
context as provided to the EditorCommandExecutor.
-
Identifies the
EditorViewContextuniquely.Declaration
Swift
public let id: String -
Friendly name for the context. It is possible to create multiple
EditorViewContextusing the same name. A context is uniquely identified byidand not the name.Declaration
Swift
public let name: String -
EditorView delegate at context level. This delegate will be notified about events in all the Editors that share this particular context. This is in addition to the
delegateavailable onEditorViewwhich works at local level for theEditorView. If you are interested in certainEditorViewDelegateevents for all the editors sharing the same context e.g. an Editor with nested Editors sharing the same context.Note
If theEditorViewis instantiated without providing an explicit context,delegatecan be set onEditorViewContext.sharedwhich is the default context for all the editors.Declaration
Swift
public weak var delegate: EditorViewDelegate? -
Default shared context. Use this in case there is only a single
EditorViewon the screen at the root level.Declaration
Swift
public static let shared: EditorViewContext -
EditorViewfor this context that is currently active.Declaration
Swift
public var activeEditorView: EditorView? { get } -
EditorViewfor this context that is currently selected. An editor is selected when in any of the following states even if it is read-only:- Gets focus
- Selected range is changed to non-nil value
- Is tapped on
Declaration
Swift
public var selectedEditorView: EditorView? { get } -
Initializes a new context
Declaration
Swift
public convenience init(name: String)Parameters
nameFriendly name for the context.
View on GitHub
EditorViewContext Class Reference