determine the maximum number of characters a UILabel can take
问题 Given a UILabel and a NSString, how do I determine how much of the string can fit inside the UILabel? I am using Xcode-5 and iOS-7. I have been trying to see what I can extract from the thread Calculating UILabel Text Size but I am not getting anywhere with the responses there. 回答1: Well, what I did here works though there may be another, more efficient (yet less straight-forward) way. What I did was just calculate the size of the rect needed for the text, see if it fits in the label's frame,