aboutsummaryrefslogtreecommitdiff
path: root/iPhone/GTMUIFont+LineHeight.m
diff options
context:
space:
mode:
Diffstat (limited to 'iPhone/GTMUIFont+LineHeight.m')
-rw-r--r--iPhone/GTMUIFont+LineHeight.m7
1 files changed, 7 insertions, 0 deletions
diff --git a/iPhone/GTMUIFont+LineHeight.m b/iPhone/GTMUIFont+LineHeight.m
index 74f8a8f..6d5ef11 100644
--- a/iPhone/GTMUIFont+LineHeight.m
+++ b/iPhone/GTMUIFont+LineHeight.m
@@ -18,8 +18,15 @@
#import "GTMUIFont+LineHeight.h"
+#import <Availability.h>
+
@implementation UIFont (GTMLineHeight)
- (CGFloat)gtm_lineHeight {
+#if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_7_0
+ // |sizeWithFont:| is deprecated in iOS 7, replaced by |sizeWithAttributes:|
return [@"Fake line with gjy" sizeWithFont:self].height;
+#else
+ return [@"Fake line with gjy" sizeWithAttributes:@{NSFontAttributeName:self}].height;
+#endif
}
@end