11/*
2- Copyright (c) 2011, Tony Million.
3- All rights reserved.
4-
5- Redistribution and use in source and binary forms, with or without
6- modification, are permitted provided that the following conditions are met:
7-
8- 1. Redistributions of source code must retain the above copyright notice, this
9- list of conditions and the following disclaimer.
10-
11- 2. Redistributions in binary form must reproduce the above copyright notice,
12- this list of conditions and the following disclaimer in the documentation
13- and/or other materials provided with the distribution.
14-
15- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
19- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25- POSSIBILITY OF SUCH DAMAGE.
2+ Copyright (c) 2011, Tony Million.
3+ All rights reserved.
4+
5+ Redistribution and use in source and binary forms, with or without
6+ modification, are permitted provided that the following conditions are met:
7+
8+ 1. Redistributions of source code must retain the above copyright notice, this
9+ list of conditions and the following disclaimer.
10+
11+ 2. Redistributions in binary form must reproduce the above copyright notice,
12+ this list of conditions and the following disclaimer in the documentation
13+ and/or other materials provided with the distribution.
14+
15+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
19+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25+ POSSIBILITY OF SUCH DAMAGE.
2626 */
2727
2828#import < Foundation/Foundation.h>
2929#import < SystemConfiguration/SystemConfiguration.h>
3030
3131
32- /* *
32+ /* *
3333 * Create NS_ENUM macro if it does not exist on the targeted version of iOS or OS X.
3434 *
3535 * @see http://nshipster.com/ns_enum-ns_options/
3838#define NS_ENUM (_type, _name ) enum _name : _type _name; enum _name : _type
3939#endif
4040
41- extern NSString *const kQNReachabilityChangedNotification ;
4241
43- typedef NS_ENUM (NSInteger , NetworkStatus ) {
44- // Apple NetworkStatus Compatible Names.
45- NotReachable = 0 ,
46- ReachableViaWiFi = 2 ,
47- ReachableViaWWAN = 1
42+ typedef NS_ENUM (NSInteger , QNNetworkStatus ) {
43+ // Apple NetworkStatus Compatible Names.
44+ QNNotReachable = 0 ,
45+ QNReachableViaWiFi = 2 ,
46+ QNReachableViaWWAN = 1
4847};
4948
49+ extern NSString *const kQNReachabilityChangedNotification ;
50+
5051@class QNReachability;
5152
5253typedef void (^NetworkReachable)(QNReachability * reachability);
@@ -55,8 +56,8 @@ typedef void (^NetworkUnreachable)(QNReachability * reachability);
5556
5657@interface QNReachability : NSObject
5758
58- @property (nonatomic , copy ) NetworkReachable reachableBlock;
59- @property (nonatomic , copy ) NetworkUnreachable unreachableBlock;
59+ @property (nonatomic , copy ) NetworkReachable reachableBlock;
60+ @property (nonatomic , copy ) NetworkUnreachable unreachableBlock;
6061
6162@property (nonatomic , assign ) BOOL reachableOnWWAN;
6263
@@ -87,7 +88,7 @@ typedef void (^NetworkUnreachable)(QNReachability * reachability);
8788// Is user intervention required?
8889-(BOOL )isInterventionRequired ;
8990
90- -(NetworkStatus )currentReachabilityStatus ;
91+ -(QNNetworkStatus )currentReachabilityStatus ;
9192-(SCNetworkReachabilityFlags)reachabilityFlags ;
9293-(NSString *)currentReachabilityString ;
9394-(NSString *)currentReachabilityFlags ;
0 commit comments