From 4a7d172faf6985bae87790def626788daa00e13b Mon Sep 17 00:00:00 2001 From: Josh Elkins Date: Fri, 6 Feb 2015 14:50:49 -0600 Subject: [PATCH] Updated deprecated method calls to use the replacement method; updated project to deployment target of iOS 7.0 --- Sample App/iPhoneMK Sample App.xcodeproj/project.pbxproj | 4 ++-- Views/MKNumberBadgeView/MKNumberBadgeView.m | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Sample App/iPhoneMK Sample App.xcodeproj/project.pbxproj b/Sample App/iPhoneMK Sample App.xcodeproj/project.pbxproj index a2ff9a2..703998b 100644 --- a/Sample App/iPhoneMK Sample App.xcodeproj/project.pbxproj +++ b/Sample App/iPhoneMK Sample App.xcodeproj/project.pbxproj @@ -682,7 +682,7 @@ GCC_THUMB_SUPPORT = NO; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; INFOPLIST_FILE = "iPhoneMK Sample App/iPhoneMK Sample App-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 6.0; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = app; }; @@ -697,7 +697,7 @@ GCC_THUMB_SUPPORT = NO; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; INFOPLIST_FILE = "iPhoneMK Sample App/iPhoneMK Sample App-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 6.0; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = app; }; diff --git a/Views/MKNumberBadgeView/MKNumberBadgeView.m b/Views/MKNumberBadgeView/MKNumberBadgeView.m index cd15bf5..a02b240 100644 --- a/Views/MKNumberBadgeView/MKNumberBadgeView.m +++ b/Views/MKNumberBadgeView/MKNumberBadgeView.m @@ -127,7 +127,7 @@ - (void)drawRect:(CGRect)rect NSString* numberString = [NSString stringWithFormat:self.textFormat,self.value]; - CGSize numberSize = [numberString sizeWithFont:self.font]; + CGSize numberSize = [numberString sizeWithAttributes:@{ NSFontAttributeName : self.font }]; CGPathRef badgePath = [self newBadgePathForTextSize:numberSize]; @@ -238,7 +238,7 @@ - (void)drawRect:(CGRect)rect CGPoint textPt = CGPointMake( ctm.x + (badgeRect.size.width - numberSize.width)/2 + self.adjustOffset.x, ctm.y + (badgeRect.size.height - numberSize.height)/2 + self.adjustOffset.y); - [numberString drawAtPoint:textPt withFont:self.font]; + [numberString drawAtPoint:textPt withAttributes:@{ NSFontAttributeName : self.font }]; CGContextRestoreGState( curContext ); @@ -286,7 +286,7 @@ - (CGSize)badgeSize NSString* numberString = [NSString stringWithFormat:self.textFormat,self.value]; - CGSize numberSize = [numberString sizeWithFont:self.font]; + CGSize numberSize = [numberString sizeWithAttributes:@{ NSFontAttributeName : self.font }]; CGPathRef badgePath = [self newBadgePathForTextSize:numberSize];