Get NSString UI Size

I would like to know UI width(Text).
If we know font size, we can calculate size using sizeAttributes method.

NSString *str = @"Hello World!";
UIFont *font = [UIFont boldSystemFontOfSize:16];
CGSize textSize = [str sizeWithAttributes:[NSDictionary dictionaryWithObject:font forKey:NSFontAttributeName]];