Monthly Archives: June 2015

Multiline UILabel frame height based on given text and width

Below is Objective C code for calculating frame height based on given text and width for multiline UILabel.

Add this methods in category. One UILabel category method and two other NSString category methods are below.

Create category for UILabel something like ‘UILabel+Utils.h’ and ‘UILabel+Utils.m’

Create another NSString category ‘NSString+Utils.h’ and ‘NSString+Utils.m’

Add methods given below to corresponding category files

Multiline UILabel frame height based on given text and width