From 32b388df374bec083050eb6b21fa62b47aebb67c Mon Sep 17 00:00:00 2001 From: thomasvl Date: Wed, 29 Oct 2014 15:41:24 +0000 Subject: Fix compilation against iOS 7 deployment target. --- iPhone/GTMUIFont+LineHeight.m | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'iPhone') 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 + @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 -- cgit v1.2.3