define MY_LABEL_FONT_SIZE18 #define MY_LABEL_TEXT_WIDTH_MULTIPLIER(MY_LABEL_FONT_SIZE/2 + 1) For example if we have a String of length 8 characters then we can find the width of the UILabel which can fit the text as :
|
8* MY_LABEL_TEXT_WIDTH_MULTIPLIERand setting the Font Size of the UILabel text as MY_LABEL_FONT_SIZE |