0

Has anyone experienced this issue on the iOS 16 beta?

The text wrapping in a simple label seems it is different in the iOS 16 beta. As you can see in the image attached, the "essentially" text goes to the line below in the iOS 16 beta, this is just a dummy example but we have seen a lot of screens where this wrapping happens.

For the record: it is the same label with the same leading and trailing constraints values, the only thing that has changed is the IOS version.

As our app needs to be "Pixel-perfect" this is a problem because we have a lot of screens to fix and we want to avoid adding iOS version logic in the code.

enter image description here

Luciano Perez
  • 101
  • 1
  • 10
  • Starting with iOS 11, UIKit does not leave "orphans" on two-lines of text, but *does* on more than two-lines... which has been inconsistent typesetting. I don't have the beta installed, but from your screen-shots it looks like it has been changed (corrected) for iOS 16. – DonMag Jun 16 '22 at 16:38
  • As a side note... in general, trying to design *"Pixel-perfect"* is a hazardous approach. Apple has (more than once) changed the System Font between iOS versions. They've also made changes to the font rendering code. Relying on dynamic text to always be pixel-perfect is risky business. – DonMag Jun 16 '22 at 16:59
  • If you *really* need to be "pixel-perfect" you likely want to use your own font and do the layout using Core Text. Too many things can change - plus you need to account for Accessibility options like Font Size and Display Zoom. – DonMag Jun 17 '22 at 15:19
  • Seems that it is related to the `lineBreakStrategy` property. I didn't test it, but you can try some different strategies. For example, `NSLineBreakStrategyPushOut` strategy allows the text system to "push out" individual lines by some number of words to avoid an orphan word on the last line of the paragraph. – HongchaoZhang Jul 26 '22 at 10:01

0 Answers0