LuxChat  2.0
Instant messenger for iOS
AFNetworkReachabilityManager.h
1 // AFNetworkReachabilityManager.h
2 //
3 // Copyright (c) 2013-2015 AFNetworking (http://afnetworking.com)
4 //
5 // Permission is hereby granted, free of charge, to any person obtaining a copy
6 // of this software and associated documentation files (the "Software"), to deal
7 // in the Software without restriction, including without limitation the rights
8 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 // copies of the Software, and to permit persons to whom the Software is
10 // furnished to do so, subject to the following conditions:
11 //
12 // The above copyright notice and this permission notice shall be included in
13 // all copies or substantial portions of the Software.
14 //
15 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 // THE SOFTWARE.
22 
23 #import <Foundation/Foundation.h>
24 #import <SystemConfiguration/SystemConfiguration.h>
25 
26 #ifndef NS_DESIGNATED_INITIALIZER
27 #if __has_attribute(objc_designated_initializer)
28 #define NS_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer))
29 #else
30 #define NS_DESIGNATED_INITIALIZER
31 #endif
32 #endif
33 
34 typedef NS_ENUM(NSInteger, AFNetworkReachabilityStatus) {
35  AFNetworkReachabilityStatusUnknown = -1,
36  AFNetworkReachabilityStatusNotReachable = 0,
37  AFNetworkReachabilityStatusReachableViaWWAN = 1,
38  AFNetworkReachabilityStatusReachableViaWiFi = 2,
39 };
40 
50 @interface AFNetworkReachabilityManager : NSObject
51 
55 @property (readonly, nonatomic, assign) AFNetworkReachabilityStatus networkReachabilityStatus;
56 
60 @property (readonly, nonatomic, assign, getter = isReachable) BOOL reachable;
61 
65 @property (readonly, nonatomic, assign, getter = isReachableViaWWAN) BOOL reachableViaWWAN;
66 
70 @property (readonly, nonatomic, assign, getter = isReachableViaWiFi) BOOL reachableViaWiFi;
71 
75 
79 + (instancetype)sharedManager;
80 
88 + (instancetype)managerForDomain:(NSString *)domain;
89 
97 + (instancetype)managerForAddress:(const void *)address;
98 
106 - (instancetype)initWithReachability:(SCNetworkReachabilityRef)reachability NS_DESIGNATED_INITIALIZER;
107 
111 
115 - (void)startMonitoring;
116 
120 - (void)stopMonitoring;
121 
125 
130 
134 
140 - (void)setReachabilityStatusChangeBlock:(void (^)(AFNetworkReachabilityStatus status))block;
141 
142 @end
143 
147 
181 
191 extern NSString * const AFNetworkingReachabilityDidChangeNotification;
192 extern NSString * const AFNetworkingReachabilityNotificationStatusItem;
193 
197 
201 extern NSString * AFStringFromNetworkReachabilityStatus(AFNetworkReachabilityStatus status);
void startMonitoring()
Definition: AFNetworkReachabilityManager.m:184
BOOL reachableViaWiFi
Definition: AFNetworkReachabilityManager.h:70
AFNetworkReachabilityStatus networkReachabilityStatus
Definition: AFNetworkReachabilityManager.h:55
instancetype sharedManager()
Definition: AFNetworkReachabilityManager.m:114
NSString * localizedNetworkReachabilityStatusString()
Definition: AFNetworkReachabilityManager.m:240
void stopMonitoring()
Definition: AFNetworkReachabilityManager.m:230
BOOL reachableViaWWAN
Definition: AFNetworkReachabilityManager.h:65
BOOL reachable
Definition: AFNetworkReachabilityManager.h:60
Definition: AFNetworkReachabilityManager.h:50
typedef NS_ENUM(NSInteger, FIRStorageTaskStatus)
Definition: FIRStorageConstants.h:69