In iOS 15 soft hyphens (\u{00AD}) are not considered when setting text on UILabel
. for example: The following code does render the text with the soft hyphen correctly in iOS 13 & 14, but not in iOS 15.
import UIKit
class ViewController: UIViewController {
@IBOutlet weak var label: UILabel!
override func viewDidLoad() {
super.viewDidLoad()
label.text = "Very\u{00AD}VeryVeryVeryVeryVeryLongWordWithASoftHyphenTo"
}
}
How can i make UILabel consider the soft hyphen (\u{00AD}) in iOS 15?
Got response from Apple for this one:
So basically now we should use languageIdentifier attribute, lesser opportunities for our own custom hyphenation rules (like remove ugly, one side short, hyphenation break), but works grammatically correctly.
Soft hyphens still working but just as an addition.