AFNetworkReachabilityManager Class Reference
| Inherits from | NSObject |
| Declared in | AFNetworkReachabilityManager.h AFNetworkReachabilityManager.m |
Overview
AFNetworkReachabilityManager monitors the reachability of domains, and addresses for both WWAN and WiFi network interfaces.
See Apple’s Reachability Sample Code (https://developer.apple.com/library/ios/samplecode/reachability/))
Warning: Instances of AFNetworkReachabilityManager must be started with startMonitoring before reachability status can be determined.
Tasks
Other Methods
-
networkReachabilityStatusproperty -
reachableproperty -
reachableViaWWANproperty -
reachableViaWiFiproperty
Initialization
Starting & Stopping Reachability Monitoring
Getting Localized Reachability Description
Setting Network Reachability Change Callback
Properties
networkReachabilityStatus
The current network reachability status.
@property (readonly, nonatomic, assign) AFNetworkReachabilityStatus networkReachabilityStatusDeclared In
AFNetworkReachabilityManager.hreachable
Whether or not the network is currently reachable.
@property (readonly, nonatomic, assign, getter=isReachable) BOOL reachableDeclared In
AFNetworkReachabilityManager.hreachableViaWWAN
Whether or not the network is currently reachable via WWAN.
@property (readonly, nonatomic, assign, getter=isReachableViaWWAN) BOOL reachableViaWWANDeclared In
AFNetworkReachabilityManager.hreachableViaWiFi
Whether or not the network is currently reachable via WiFi.
@property (readonly, nonatomic, assign, getter=isReachableViaWiFi) BOOL reachableViaWiFiDeclared In
AFNetworkReachabilityManager.hClass Methods
managerForAddress:
Creates and returns a network reachability manager for the socket address.
+ (instancetype)managerForAddress:(const struct sockaddr_in *)addressParameters
- address
The socket address used to evaluate network reachability.
Return Value
An initialized network reachability manager, actively monitoring the specified socket address.
Declared In
AFNetworkReachabilityManager.hmanagerForDomain:
Creates and returns a network reachability manager for the specified domain.
+ (instancetype)managerForDomain:(NSString *)domainParameters
- domain
The domain used to evaluate network reachability.
Return Value
An initialized network reachability manager, actively monitoring the specified domain.
Declared In
AFNetworkReachabilityManager.hInstance Methods
initWithReachability:
Initializes an instance of a network reachability manager from the specified reachability object.
- (instancetype)initWithReachability:(SCNetworkReachabilityRef)reachabilityParameters
- reachability
The reachability object to monitor.
Return Value
An initialized network reachability manager, actively monitoring the specified reachability.
Declared In
AFNetworkReachabilityManager.hlocalizedNetworkReachabilityStatusString
Returns a localized string representation of the current network reachability status.
- (NSString *)localizedNetworkReachabilityStatusStringDeclared In
AFNetworkReachabilityManager.hsetReachabilityStatusChangeBlock:
Sets a callback to be executed when the network availability of the baseURL host changes.
- (void)setReachabilityStatusChangeBlock:(void ( ^ ) ( AFNetworkReachabilityStatus status ))blockParameters
- block
A block object to be executed when the network availability of the
baseURLhost changes.. This block has no return value and takes a single argument which represents the various reachability states from the device to thebaseURL.
Declared In
AFNetworkReachabilityManager.h