In a UILabel, is it possible to force a line NOT to break in a certain place In a UILabel, is it possible to force a line NOT to break in a certain place ios ios

In a UILabel, is it possible to force a line NOT to break in a certain place


You could use a non-breaking space (\u00a0) to join textFragment2 and textFragment3. This character looks just like a normal space—i.e. it results in the same amount of whitespace—but line breaking will not take place on either side of it.

You could also use a zero-width space (\u2060). Using this character will not result in any whitespace, but it will still prevent line breaking on either side. This is what you want if you don’t want any space between textFragment2 and textFragment3 but you still want to prevent line breaking there. (It’s also useful if you have a word with a hyphen in the middle of it but you want to prevent the line from being broken after the hyphen.)

You can read more about these kinds of characters on Wikipedia.