Revision: 697
Author: thomasvl
Date: Wed Oct 29 15:41:24 2014 UTC
Log: Fix compilation against iOS 7 deployment target.
https://code.google.com/p/google-toolbox-for-mac/source/detail?r=697
Modified:
/trunk/iPhone/GTMUIFont+LineHeight.m
=======================================
--- /trunk/iPhone/GTMUIFont+LineHeight.m Tue Nov 4 20:10:52 2008 UTC
+++ /trunk/iPhone/GTMUIFont+LineHeight.m Wed Oct 29 15:41:24 2014 UTC
@@ -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