计算文字宽度
NSString *content = @"欢迎来到北京";
CGSize size =[content sizeWithAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:14]}];
计算文字高度
NSString *str = @"我爱北京天安门";
CGRect textRect = [str boundingRectWithSize:CGSizeMake(200, 2000) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:15]} context:nil];