From 56cd4dbce168d104e4f77b12f860b67e8fe322ff Mon Sep 17 00:00:00 2001 From: Nikita Vasilev Date: Fri, 10 Jul 2026 20:07:18 +0400 Subject: [PATCH] feat: add `adjustsFontSizeToFitWidth` & `minimumScaleFactor` methods --- .../Classes/Extensions/FlexUI+UILabel.swift | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/Sources/FlexUI/Classes/Extensions/FlexUI+UILabel.swift b/Sources/FlexUI/Classes/Extensions/FlexUI+UILabel.swift index 4b478d8..3fed5a0 100644 --- a/Sources/FlexUI/Classes/Extensions/FlexUI+UILabel.swift +++ b/Sources/FlexUI/Classes/Extensions/FlexUI+UILabel.swift @@ -71,4 +71,25 @@ public extension FlexUI where Component: UILabel { component.textAlignment = textAlignment return self } + + /// A Boolean value that determines whether the label reduces the text’s font size to fit the + /// title string into the label’s bounding rectangle. + /// + /// - Returns: The current instance of `FlexUI` for further configuration. + @discardableResult + @MainActor + func adjustsFontSizeToFitWidth(_ adjustsFontSizeToFitWidth: Bool) -> Self { + component.adjustsFontSizeToFitWidth = adjustsFontSizeToFitWidth + return self + } + + /// The minimum scale factor for the label’s text. + /// + /// - Returns: The current instance of `FlexUI` for further configuration. + @discardableResult + @MainActor + func minimumScaleFactor(_ minimumScaleFactor: CGFloat) -> Self { + component.minimumScaleFactor = minimumScaleFactor + return self + } }