[google-toolbox-for-mac] r697 committed - Fix compilation against iOS 7 deployment target.

140 views
Skip to first unread message

google-tool...@googlecode.com

unread,
Oct 29, 2014, 11:41:39 AM10/29/14
to google-tool...@googlegroups.com
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
Reply all
Reply to author
Forward
0 new messages