Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
Namespaced reachability notification constant
Browse files Browse the repository at this point in the history
Fixes #1717.
  • Loading branch information
1ec5 committed Jun 12, 2015
1 parent 7dc8800 commit 4176d21
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion include/mbgl/platform/darwin/reachability.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions platform/darwin/reachability.m
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
#import <netdb.h>


NSString *const kReachabilityChangedNotification = @"kReachabilityChangedNotification";
NSString *const kMGLReachabilityChangedNotification = @"kMGLReachabilityChangedNotification";


@interface MGLReachability ()
Expand Down Expand Up @@ -452,7 +452,7 @@ -(void)reachabilityChanged:(SCNetworkReachabilityFlags)flags

// 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];
});
}
Expand Down
2 changes: 1 addition & 1 deletion platform/ios/MGLMapView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ - (void)commonInit
// 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];
Expand Down

0 comments on commit 4176d21

Please sign in to comment.