Skip to content

Commit 6b3de44

Browse files
authored
feat: add adjustsFontSizeToFitWidth & minimumScaleFactor methods (#104)
1 parent 913b800 commit 6b3de44

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

‎Sources/FlexUI/Classes/Extensions/FlexUI+UILabel.swift‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,25 @@ public extension FlexUI where Component: UILabel {
7171
component.textAlignment = textAlignment
7272
return self
7373
}
74+
75+
/// A Boolean value that determines whether the label reduces the text’s font size to fit the
76+
/// title string into the label’s bounding rectangle.
77+
///
78+
/// - Returns: The current instance of `FlexUI` for further configuration.
79+
@discardableResult
80+
@MainActor
81+
func adjustsFontSizeToFitWidth(_ adjustsFontSizeToFitWidth: Bool) -> Self {
82+
component.adjustsFontSizeToFitWidth = adjustsFontSizeToFitWidth
83+
return self
84+
}
85+
86+
/// The minimum scale factor for the label’s text.
87+
///
88+
/// - Returns: The current instance of `FlexUI` for further configuration.
89+
@discardableResult
90+
@MainActor
91+
func minimumScaleFactor(_ minimumScaleFactor: CGFloat) -> Self {
92+
component.minimumScaleFactor = minimumScaleFactor
93+
return self
94+
}
7495
}

0 commit comments

Comments
 (0)