keep TextKit 1 in Labels as default in iOS 16

Due to the iOS 16 will be using TextKit 2 as default, does anyone know if it is possible to set TextKit 1 as default in the UILabels in iOS 16? We need to keep the same UI in iOS 16 and iOS 15 by contract (the app only supports iPhone 11 pro) and we have found a lot of UILabels that render its contents in a different way during our first test in iOS 16.

I’m sure you realize this, but looking for a technical fix for this is almost certainly not going to be fruitful. It’s a new major OS release and Apple decided to improve their text layout logic, and of course they are perfectly free to do that since there’s never been any guarantee of pixel-perfect consistency across releases. I’d be floored if they really decided to add a Text Kit 1 compatibility mode in order to address what you must admit is an edge case not relevant to the overwhelming majority of apps.

The real issue, of course, is that someone in your organization unfortunately committed you to a requirement that’s technically infeasible. Aside from finding someone on the other side of the negotiating table who understands and accepts this (that your app isn’t a game and doesn’t draw all the pixels), don’t expect an easy solution.

(But I’d love to be wrong. Maybe someone with an  in their username will chime in and disclose an undocumented API that does exactly what you need. 😉)

Thanks for the reply, I do realize what you are saying but according to Apple, they support both (textKit1 and textKit2). https://developer.apple.com/videos/play/wwdc2021/10061/ (minute 2:08)

For instance, you can change this in a TextView under the text layout option (image attached), please see this for references: https://developer.apple.com/videos/play/wwdc2022/10090/ (minute 5:24)

That said, if Apple supports this, do they support changing this in a UILabel? yes? no? if not, why not?

My takeaway from those videos is this: UITextView needs a TextKit 1 compatibility mode because its existing API lets you access the underlying TextKit 1 objects, most notably the layoutManager property. If they removed support for that, then existing code would break.

In contrast, UITextField and UILabel never had API for accessing the underlying TextKit 1 objects. So updating the implementation to use only TextKit 2 can’t break existing code.

For your pixel-perfect problem, at least TextKit 1 isn’t going away, so you could build your own drop-in UILabel replacement, using either UITextView in TextKit 1 mode or a plain UIView with a whole TextKit 1 stack implemented inside. Not exactly trivial but you would be back in full control.

keep TextKit 1 in Labels as default in iOS 16
 
 
Q