IPhone line break with i18n

I need to split a line in lines so that each of them does not exceed the maximum number of characters in a line. I can't just break the Nth character because I don't want to break the middle of the word. The application is internationalized, therefore, since the border of the text is locale sensitive, I cannot just break the ".".

Are there any things to help do this in the Cocoa API?

I use OpenGLES, rendering text with textures, so the user interface components that handle this will not help.

thank

+3
source share
1 answer

Use NSString - substringFromIndex :, - substringWithRange :, - substringToIndex :.

, .

http://developer.apple.com/library/ios/#documentation/cocoa/reference/foundation/Classes/NSString_Class/Reference/NSString.html

0

Source: https://habr.com/ru/post/1775660/


All Articles