You are looking for the ReachableViaWiFi network status, which is broadcast via NSNotification. You can setup that up in your code like this:
@property (nonatomic, assign) NetworkStatus currentNetStatus;
...
- (void) startListeningForWifi{
Reachability* hostReach = [Reachability reachabilityWithHostName:@"hostName"];
[hostReach startNotifier];
// reachability set up
// Observe the kNetworkReachabilityChangedNotification. When that notification is posted, the
// method "reachabilityChanged" will be called.
[[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(reachabilityChanged:) name: kReachabilityChangedNotification object: nil];
}
- (void)reachabilityChanged: (NSNotification* )note{
Reachability *curReach = [note object];
self.currentNetStatus = [curReach currentReachabilityStatus];
}
Then it's easy to check the currentNetStatus
before you make a network call. If that is not equal to ReachableViaWiFi
then you are not on wifi.