EditorLine
public struct EditorLine
Representation of a line of text in EditorView
. A line is defined as a single fragment starting from the beginning of
bounds of EditorView
to the end. A line may have any number of characters based on the contents in the EditorView
.
Note
A line does not represent a full sentence in theEditorView
but instead may start and/or end in the middle of
another based on how the content is laid out in the EditorView
.
-
Text contained in the current line.
Declaration
Swift
public let text: NSAttributedString
-
Range of text in the
EditorView
for the current line.Declaration
Swift
public let range: NSRange
-
Determines if the current line starts with given text. Text comparison is case-sensitive.
Declaration
Swift
public func startsWith(_ text: String) -> Bool
Parameters
text
Text to compare
Return Value
true
if the current line text starts with the given string. -
Determines if the current line ends with given text. Text comparison is case-sensitive.
Declaration
Swift
public func endsWith(_ text: String) -> Bool
Parameters
text
Text to compare
Return Value
true
if the current line text ends with the given string.