Skip to content

Commit e9f1d1c

Browse files
committed
fix backward compatibility
1 parent b561e32 commit e9f1d1c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Sources/UIComponent/Components/View/Text.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,11 @@ public struct TextRenderNode: RenderNode {
217217
self.size = size
218218
}
219219

220+
/// Convenience initializer for creating a `TextRenderNode` with a plain string.
221+
public init(attributedString: NSAttributedString, numberOfLines: Int, lineBreakMode: NSLineBreakMode, size: CGSize) {
222+
self.init(content: .attributedString(attributedString), numberOfLines: numberOfLines, lineBreakMode: lineBreakMode, size: size)
223+
}
224+
220225
/// Updates the provided `UILabel` with the render node's properties.
221226
/// - Parameter label: The `UILabel` to update with the text rendering information.
222227
public func updateView(_ label: UILabel) {

0 commit comments

Comments
 (0)