why does cyrillic letters in NSMutableAttributedString give NSRange length of 2 for each character in ios 15 and only 1 for each character in ios 17?
Generated on 8/5/2024
1 search
The difference in the NSRange length for Cyrillic letters between iOS 15 and iOS 17 is likely due to changes in the text rendering and handling APIs introduced in the newer versions of iOS.
In iOS 15, the text rendering system might have treated certain characters, especially those from non-Latin scripts like Cyrillic, as composed characters, resulting in a length of 2 for each character. This could be due to the way the text engine handled Unicode characters and their combining marks.
In iOS 17, improvements and updates to the text rendering system, such as those mentioned in the session Build multilingual-ready apps, have likely optimized the handling of Unicode characters, ensuring that each character, including Cyrillic letters, is treated as a single unit, resulting in a length of 1.
These updates are part of Apple's ongoing efforts to improve text handling and rendering across different languages and scripts, ensuring better accuracy and performance in multilingual applications.
Bring expression to your app with Genmoji
Discover how to bring Genmoji to life in your app. We’ll go over how to render, store, and communicate text that includes Genmoji. If your app features a custom text engine, we’ll also cover techniques for adding support for Genmoji.
Get started with Writing Tools
Learn how Writing Tools help users proofread, rewrite, and transform text in your app. Get the details on how Writing Tools interact with your app so users can refine what they have written in any text view. Understand how text is retrieved and processed, and how to support Writing Tools in custom text views.
Build multilingual-ready apps
Ensure your app works properly and effectively for multilingual users. Learn best practices for text input, display, search, and formatting. Get details on typing in multiple languages without switching between keyboards. And find out how the latest advances in the String Catalog can make localization even easier.
Create custom visual effects with SwiftUI
Discover how to create stunning visual effects in SwiftUI. Learn to build unique scroll effects, rich color treatments, and custom transitions. We’ll also explore advanced graphic effects using Metal shaders and custom text rendering.