Using IOS 4, I want to understand programatically if a given text is fitting to a certain UILabel or not, can i get that information without doing complex calculations? if not what is the most basic approach for calculating that?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
NSString method sizeWithFont:contrainedToSize:lineBreakMode: could help. It will give you CGSize with calculated size of string. Just compare this with your UILabel.frame.size.