LemonCake/MSLabel — pull request #18 by mlawrie (2013-04-09 19:09:10+00:00)
Title: Replace implementation of UILineBreakModeWordWrap with a version which handles whitespace correctly

I've rewritten your stringsWithWordsWrappedFromArray and replaced it with a new function, stringsWithWordsWrappedFromString. When using MSLabel I encountered an issue with this method where it dropped whitespace when wrapping new lines. Since the code wasn't very easy for me to understand, I rewrote the word wrapper so that it functions independently of the existing wrapping functionality.

This version tokenizes the string and adds words one by one until the target length is reached. As with the original version, it also adds the ... at the end of the last line if the total length is too great.

I haven't tested this extensively, but it is working well. If you are unaware of the problem, I can send you a sample project which demonstrates the bug this code endeavours to fix.