I have a UITextView in which I am showing the result of a calculation. Unfortunately, if there is a negative sign in front of a number, and the number is near the edge, UITextView is wrapping the number by splitting it at the negative sign like this:
Current behavior:
Answer = -
123456789
Instead I would like it to show:
Answer =
-123456789
In the current behavior, there is a risk that the user does not see the minus sign and misinterprets the answer.
To solve this, I could force a line break in front of the answer, but sometimes the entire string will fit on one line, in which case I would prefer to leave it all on one line if the answer is short enough. Is there an easy way to prevent UITextView from wrapping in between the minus sign, or do I need to resign myself to forcing a line break?
Sometimes the first part of the answer has a few words in it, and could itself also require a line break, so in other words, it could look like this if I just forced a line break:
The result of the calculation
is
-2
but in that case I would rather keep the "-2" next to the word "is", so that it would read as follows:
The result of the calculation
is -2