Wei
Wei

Reputation: 3482

How can I know the network Reachability by AFNetworking?

setReachabilityStatusChangeBlock can get status when network reachability changed, but it can not get status when App Launch.

I know Reachability can do this, but I don't know whether AFNetworking has this feature ?

Upvotes: 0

Views: 3215

Answers (2)

Lithu T.V
Lithu T.V

Reputation: 20021

networkReachabilityStatus

The reachability status from the device to the current baseURL of the AFHTTPClient.

@property (readonly, nonatomic, assign) AFNetworkReachabilityStatus networkReachabilityStatus

Discussion

The reachability status from the device to the current baseURL of the AFHTTPClient.

Warning: This property requires the SystemConfiguration framework. Add it in the active target’s “Link Binary With Library” build phase, and add #import to the header prefix of the project (Prefix.pch).

Declared In AFHTTPClient.h

Upvotes: 0

Marcelo
Marcelo

Reputation: 9944

[AFHTTPClient -networkReachabilityStatus], as shown in the docs.

Upvotes: 1

Related Questions