I have a multiline UILabel whose font size I\'d like to adjust depending on the text length. The whole text should fit into the label\'s frame without truncating it.
Thought I would add my own take on the answer:
I think it's a slight improvement on some of the other answers because:
https://gist.github.com/chrisjrex/c571056a4b621f7099bcbd5e179f184f
Note: This solution should only be used when a UILabel has .numberOfLines = 0
and .lineBreakMode = .byWordWrapping
Otherwise you are better off using: .adjustFontSizeForWidth = true
from the standard swift library
The other answers on this thread were very helpful to me in coming up with my solution, thank you