Skip to content

Commit 6ec6723

Browse files
committed
Add contentFrame public property to STTextView
Add a public contentFrame property to STTextView on both AppKit and UIKit that exposes the frame of the contentView. This allows external code to access the frame of the text view's content.
1 parent 242fc4e commit 6ec6723

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

Sources/STTextViewAppKit/STTextView.swift

+5
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,11 @@ import AVFoundation
430430
/// Content view. Layout fragments content.
431431
internal let contentView: STContentView
432432

433+
/// Content frame. Layout fragments content frame.
434+
public var contentFrame: CGRect {
435+
contentView.frame
436+
}
437+
433438
/// Selection highlight content view.
434439
internal let selectionView: STSelectionView
435440

Sources/STTextViewUIKit/STTextView.swift

+5
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,11 @@ import STTextViewCommon
183183
/// Content view. Layout fragments content.
184184
internal let contentView: STContentView
185185

186+
/// Content frame. Layout fragments content frame.
187+
public var contentFrame: CGRect {
188+
contentView.frame
189+
}
190+
186191
/// Line highlight view.
187192
internal let lineHighlightView: STLineHighlightView
188193

0 commit comments

Comments
 (0)