From 4176d21d1c1fd82db5e73c45cfd405ef98236f1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguy=E1=BB=85n?= Date: Fri, 12 Jun 2015 11:54:46 -0700 Subject: [PATCH] Namespaced reachability notification constant Fixes #1717. --- include/mbgl/platform/darwin/reachability.h | 2 +- platform/darwin/reachability.m | 4 ++-- platform/ios/MGLMapView.mm | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/mbgl/platform/darwin/reachability.h b/include/mbgl/platform/darwin/reachability.h index 0101b91d4..78e302eaf 100644 --- a/include/mbgl/platform/darwin/reachability.h +++ b/include/mbgl/platform/darwin/reachability.h @@ -38,7 +38,7 @@ #define NS_ENUM(_type, _name) enum _name : _type _name; enum _name : _type #endif -extern NSString *const kReachabilityChangedNotification; +extern NSString *const kMGLReachabilityChangedNotification; typedef NS_ENUM(NSInteger, NetworkStatus) { // Apple NetworkStatus Compatible Names. diff --git a/platform/darwin/reachability.m b/platform/darwin/reachability.m index d1413321b..8abcf5ae6 100644 --- a/platform/darwin/reachability.m +++ b/platform/darwin/reachability.m @@ -35,7 +35,7 @@ #import -NSString *const kReachabilityChangedNotification = @"kReachabilityChangedNotification"; +NSString *const kMGLReachabilityChangedNotification = @"kMGLReachabilityChangedNotification"; @interface MGLReachability () @@ -452,7 +452,7 @@ static void TMReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkRea // this makes sure the change notification happens on the MAIN THREAD dispatch_async(dispatch_get_main_queue(), ^{ - [[NSNotificationCenter defaultCenter] postNotificationName:kReachabilityChangedNotification + [[NSNotificationCenter defaultCenter] postNotificationName:kMGLReachabilityChangedNotification object:self]; }); } diff --git a/platform/ios/MGLMapView.mm b/platform/ios/MGLMapView.mm index d4c26d6c9..793363b63 100644 --- a/platform/ios/MGLMapView.mm +++ b/platform/ios/MGLMapView.mm @@ -256,7 +256,7 @@ std::chrono::steady_clock::duration secondsAsDuration(float duration) // Notify map object when network reachability status changes. [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reachabilityChanged:) - name:kReachabilityChangedNotification + name:kMGLReachabilityChangedNotification object:nil]; MGLReachability* reachability = [MGLReachability reachabilityForInternetConnection];