diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2015-05-26 11:08:31 +0200 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2015-05-26 11:08:31 +0200 |
commit | ba3a6ea2b0ab60ac66db0add9f98a042c8c62477 (patch) | |
tree | a2386fc6e3c50fbe3d592698702221e65307aefa /include | |
parent | 343941d24c4547823f19b49b3f43b093c1997086 (diff) | |
download | qtlocation-mapboxgl-ba3a6ea2b0ab60ac66db0add9f98a042c8c62477.tar.gz |
update Reachability with latest version
Diffstat (limited to 'include')
-rw-r--r-- | include/mbgl/platform/darwin/reachability.h | 33 |
1 files changed, 8 insertions, 25 deletions
diff --git a/include/mbgl/platform/darwin/reachability.h b/include/mbgl/platform/darwin/reachability.h index 1cf7d2ecea..8cb2a6fe70 100644 --- a/include/mbgl/platform/darwin/reachability.h +++ b/include/mbgl/platform/darwin/reachability.h @@ -28,24 +28,6 @@ #import <Foundation/Foundation.h> #import <SystemConfiguration/SystemConfiguration.h> -#import <sys/socket.h> -#import <netinet/in.h> -#import <netinet6/in6.h> -#import <arpa/inet.h> -#import <ifaddrs.h> -#import <netdb.h> - -/** - * Does ARC support GCD objects? - * It does if the minimum deployment target is iOS 6+ or Mac OS X 8+ - * - * @see http://opensource.apple.com/source/libdispatch/libdispatch-228.18/os/object.h - **/ -#if OS_OBJECT_USE_OBJC -#define NEEDS_DISPATCH_RETAIN_RELEASE 0 -#else -#define NEEDS_DISPATCH_RETAIN_RELEASE 1 -#endif /** * Create NS_ENUM macro if it does not exist on the targeted version of iOS or OS X. @@ -70,23 +52,24 @@ typedef NS_ENUM(NSInteger, NetworkStatus) { typedef void (^NetworkReachable)(Reachability * reachability); typedef void (^NetworkUnreachable)(Reachability * reachability); + @interface Reachability : NSObject @property (nonatomic, copy) NetworkReachable reachableBlock; @property (nonatomic, copy) NetworkUnreachable unreachableBlock; - @property (nonatomic, assign) BOOL reachableOnWWAN; -+(Reachability*)reachabilityWithHostname:(NSString*)hostname; + ++(instancetype)reachabilityWithHostname:(NSString*)hostname; // This is identical to the function above, but is here to maintain //compatibility with Apples original code. (see .m) -+(Reachability*)reachabilityWithHostName:(NSString*)hostname; -+(Reachability*)reachabilityForInternetConnection; -+(Reachability*)reachabilityWithAddress:(const struct sockaddr_in*)hostAddress; -+(Reachability*)reachabilityForLocalWiFi; ++(instancetype)reachabilityWithHostName:(NSString*)hostname; ++(instancetype)reachabilityForInternetConnection; ++(instancetype)reachabilityWithAddress:(void *)hostAddress; ++(instancetype)reachabilityForLocalWiFi; --(Reachability *)initWithReachabilityRef:(SCNetworkReachabilityRef)ref; +-(instancetype)initWithReachabilityRef:(SCNetworkReachabilityRef)ref; -(BOOL)startNotifier; -(void)stopNotifier; |