diff options
author | Vitaly Takmazov | 2014-02-01 20:17:24 +0400 |
---|---|---|
committer | Vitaly Takmazov | 2014-02-01 20:17:24 +0400 |
commit | 50a0ecf985bbe81aacfac85192652c2495b769f6 (patch) | |
tree | 7edef997c75b5c3de28834782efbc671f026a855 /Juick/UILabel+Utils.m | |
parent | 6ee0e66d56f02c4b534dd83fca24cb0c1f408f06 (diff) |
move UILabel sizeForLabel to category
Diffstat (limited to 'Juick/UILabel+Utils.m')
-rw-r--r-- | Juick/UILabel+Utils.m | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Juick/UILabel+Utils.m b/Juick/UILabel+Utils.m new file mode 100644 index 0000000..91136d0 --- /dev/null +++ b/Juick/UILabel+Utils.m @@ -0,0 +1,16 @@ +// +// UILabel+Utils.m +// Juick +// +// Created by Vitaly on 01.02.14. +// Copyright (c) 2014 com.juick. All rights reserved. +// + +#import "UILabel+Utils.h" + +@implementation UILabel (Utils) + ++ (CGRect) sizeForLabel:(UILabel *)label width:(CGFloat)width { + return [label.text boundingRectWithSize:(CGSize) {width, CGFLOAT_MAX} options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName:label.font} context:nil]; +} +@end |