#define MAIN_FONT_SIZE 17
#define MIN_MAIN_FONT_SIZE 11
#define MAX_TEXT_WIDTH 100
CGPoint point;
CGFloat actualFontSize;
CGSize size;
UIFont *mainFont = [UIFont systemFontOfSize:MAIN_FONT_SIZE];
NSString *string = @"A String Of Text";
size = [string sizeWithFont:mainFont
minFontSize:MIN_MAIN_FONT_SIZE
actualFontSize:&actualFontSize
forWidth:MAX_TEXT_WIDTH
lineBreakMode:UILineBreakModeTailTruncation];
From here you can either adjust the width of your textField:
[textField setFrameSize:NSMakeSize(size.width,textField.frame.size.height)];
Or you can draw the text at a calculated point based on the size:
point = CGPointMake(textXPosition, textYPosition);
[string drawAtPoint:point
forWidth:MAX_TEXT_WIDTH
withFont:mainFont
minFontSize:actualFontSize actualFontSize:&actualFontSize
lineBreakMode:UILineBreakModeTailTruncation
baselineAdjustment:UIBaselineAdjustmentAlignBaselines];