aboutsummaryrefslogtreecommitdiff
path: root/iPhone
diff options
context:
space:
mode:
authorGravatar thomasvl <thomasvl@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2014-10-29 15:41:24 +0000
committerGravatar thomasvl <thomasvl@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2014-10-29 15:41:24 +0000
commit32b388df374bec083050eb6b21fa62b47aebb67c (patch)
treebd9976267214995284f2080a22026141c15f1ebd /iPhone
parent8e027c6365086c5b30dd39569ba61656c8eef102 (diff)
Fix compilation against iOS 7 deployment target.
Diffstat (limited to 'iPhone')
-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