From f11a9f8fd9f4a53195168518f6ef1efe782f1cf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20K=C3=A4fer?= Date: Tue, 26 May 2015 11:13:08 +0200 Subject: [PATCH] prefix Reachability with "MGL" to avoid linking conflicts and app store rejections --- include/mbgl/platform/darwin/reachability.h | 8 ++++---- platform/darwin/reachability.m | 10 +++++----- platform/ios/MGLMapView.mm | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/mbgl/platform/darwin/reachability.h b/include/mbgl/platform/darwin/reachability.h index 8cb2a6fe7..0101b91d4 100644 --- a/include/mbgl/platform/darwin/reachability.h +++ b/include/mbgl/platform/darwin/reachability.h @@ -47,13 +47,13 @@ typedef NS_ENUM(NSInteger, NetworkStatus) { ReachableViaWWAN = 1 }; -@class Reachability; +@class MGLReachability; -typedef void (^NetworkReachable)(Reachability * reachability); -typedef void (^NetworkUnreachable)(Reachability * reachability); +typedef void (^NetworkReachable)(MGLReachability * reachability); +typedef void (^NetworkUnreachable)(MGLReachability * reachability); -@interface Reachability : NSObject +@interface MGLReachability : NSObject @property (nonatomic, copy) NetworkReachable reachableBlock; @property (nonatomic, copy) NetworkUnreachable unreachableBlock; diff --git a/platform/darwin/reachability.m b/platform/darwin/reachability.m index b0818b883..d1413321b 100644 --- a/platform/darwin/reachability.m +++ b/platform/darwin/reachability.m @@ -25,7 +25,7 @@ POSSIBILITY OF SUCH DAMAGE. */ -#import "Reachability.h" +#import #import #import @@ -38,7 +38,7 @@ NSString *const kReachabilityChangedNotification = @"kReachabilityChangedNotification"; -@interface Reachability () +@interface MGLReachability () @property (nonatomic, assign) SCNetworkReachabilityRef reachabilityRef; @property (nonatomic, strong) dispatch_queue_t reachabilitySerialQueue; @@ -73,7 +73,7 @@ static void TMReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkRea { #pragma unused (target) - Reachability *reachability = ((__bridge Reachability*)info); + MGLReachability *reachability = ((__bridge MGLReachability*)info); // We probably don't need an autoreleasepool here, as GCD docs state each queue has its own autorelease pool, // but what the heck eh? @@ -84,13 +84,13 @@ static void TMReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkRea } -@implementation Reachability +@implementation MGLReachability #pragma mark - Class Constructor Methods +(instancetype)reachabilityWithHostName:(NSString*)hostname { - return [Reachability reachabilityWithHostname:hostname]; + return [MGLReachability reachabilityWithHostname:hostname]; } +(instancetype)reachabilityWithHostname:(NSString*)hostname diff --git a/platform/ios/MGLMapView.mm b/platform/ios/MGLMapView.mm index a0ec6774d..bdbfbd072 100644 --- a/platform/ios/MGLMapView.mm +++ b/platform/ios/MGLMapView.mm @@ -270,7 +270,7 @@ std::chrono::steady_clock::duration secondsAsDuration(float duration) name:kReachabilityChangedNotification object:nil]; - Reachability* reachability = [Reachability reachabilityForInternetConnection]; + MGLReachability* reachability = [MGLReachability reachabilityForInternetConnection]; [reachability startNotifier]; // setup annotations @@ -399,7 +399,7 @@ std::chrono::steady_clock::duration secondsAsDuration(float duration) -(void)reachabilityChanged:(NSNotification*)notification { - Reachability *reachability = [notification object]; + MGLReachability *reachability = [notification object]; if ([reachability isReachable]) { mbgl::NetworkStatus::Reachable(); }