Dynamically sizing text with kerning to occupy the full width of a UILabel
问题 I have a layout with a UILabel placed above a fixed width view, shown below as a grey rectangle. The text needs to match the width of the fixed grey view. I achieved this by setting the adjustsFontSizeToFitWidth property on the UILabel to YES , settings the font size to something really large, and setting the minimumScaleFactor to something suitable small. This worked fine until… I had to add kerning to said text. I added the kerning by applying @{NSKernAttributeName: @1.40} to an attributed