gliubc
6/26/2018 - 9:58 AM

boundingRectWithSize

boundingRectWithSize

    NSDictionary *attributes = @{NSFontAttributeName: [UIFont systemFontOfSize:14]};
    CGRect rect = [textToMeasure boundingRectWithSize:CGSizeMake(self.collectionView.frame.size.width, CGFLOAT_MAX)
                                              options:NSStringDrawingUsesLineFragmentOrigin
                                           attributes:attributes
                                              context:nil];