From 8349b2c103825e5b33ced9c331c5a68d10921944 Mon Sep 17 00:00:00 2001 From: Charles Powell Date: Tue, 15 Jun 2021 18:13:38 -0700 Subject: [PATCH] Add Special Note about font resizing --- README.mdown | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.mdown b/README.mdown index 6f340d9..6763a50 100644 --- a/README.mdown +++ b/README.mdown @@ -93,6 +93,16 @@ Also check out [the Extras folder](/Extras), a collection of subclasses, extensi ## Special Notes +#### Automatic Font Size Adjustment + +Starting with release 4.1, MarqueeLabel allows setting the [`adjustsFontSizeToWidth`](https://developer.apple.com/documentation/uikit/uilabel/1620546-adjustsfontsizetofitwidth) to `true`. When configured this way, MarqueeLabel will check to see if the text string + (non-attributed or attributed) will fit within the frame when adjusted to the specified minimum scale factor, and: + + - if the text will fit at the adjusted scale without requiring truncation, the label will **not scroll**. Instead, the label text will be allowed to adjust to that size and will remain static. + - if the text will not fit, the label will scroll and retain the unscaled font size (i.e., like all releases prior to 4.1) + + Previously MarqueeLabel would override any attempts to set `adjustsFontSizetoWidth` and `minimumScaleFactor` to the default settings used by UILabel (`false`, and `0.0`, respectively). As such the default behavior remains the same: the label will not adjust it's font size to 'avoid' scrolling. + #### IBDesignables MarqueeLabel includes support for IBInspectable and IBDesignable, to allow configuration of the label inside Interface Builder/Storyboards. However, if you see these warnings when building: