@@ -79,7 +79,7 @@ public extension TypographyLayout {
7979 /// Style plain text using this layout
8080 /// - Parameters:
8181 /// - text: the text to style
82- /// - isSingleLine: `true` for single line text, `false` for potentially multi-line text.
82+ /// - lineMode: line mode of the text.
8383 /// Paragraph styles will not be applied to single line text.
8484 /// - additionalAttributes: any additional attributes to apply
8585 /// (e.g. `UITextView` requires `.foregroundColor`), default = `[:]`
@@ -98,8 +98,8 @@ public extension TypographyLayout {
9898
9999 /// Style attributed text using this layout
100100 /// - Parameters:
101- /// - text : the text to style
102- /// - isSingleLine: `true` for single line text, `false` for potentially multi-line text.
101+ /// - attributedText : the attrubuted text to style
102+ /// - lineMode: line mode of the text.
103103 /// Paragraph styles will not be applied to single line text.
104104 /// - additionalAttributes: any additional attributes to apply
105105 /// (e.g. `UITextView` requires `.foregroundColor`), default = `[:]`
@@ -112,12 +112,20 @@ public extension TypographyLayout {
112112 let attributes = buildAttributes ( startingWith: additionalAttributes, lineMode: lineMode)
113113 return attributedText. textCase ( textCase) . attributedString ( with: attributes)
114114 }
115- }
116115
117- private extension TypographyLayout {
116+ /// Generates the text attributes needed to apply this typographical layout.
117+ ///
118+ /// These attributes may change (because the font may change) any time there is a change in
119+ /// content size category (Dynamic Type) or legibility weight (Accessibility Bold Text).
120+ /// - Parameters:
121+ /// - additionalAttributes: any additional attributes to combine with the typographical attributes.
122+ /// Default = `[:]`
123+ /// - lineMode: line mode of the text. Default = `.single`.
124+ /// Paragraph styles will not be applied to single line text.
125+ /// - Returns: the dictionary of attributes needed to style the text.
118126 func buildAttributes(
119- startingWith additionalAttributes: [ NSAttributedString . Key : Any ] ,
120- lineMode: Typography . LineMode
127+ startingWith additionalAttributes: [ NSAttributedString . Key : Any ] = [ : ] ,
128+ lineMode: Typography . LineMode = . single
121129 ) -> [ NSAttributedString . Key : Any ] {
122130 var attributes = additionalAttributes
123131 if case let . multi( textAlignment, lineBreakMode) = lineMode {
0 commit comments