I know for previous version of iOS, you would use the Reachability framework by apple. But if I remember correctly in iOS 7 or iOS 8 there was a new way to check if a user was connected to wifi or cellular. I would like to check to know if I load fancy videos or just poster images. Or even for later iOS versions you need to still use Reachability?
-(void)isNetworkReachable
{
NetworkStatus remoteHostStatus = [[Reachability reachabilityForInternetConnection] currentReachabilityStatus];
if (remoteHostStatus == ReachableViaWWAN){
NSLog(@"LAN/WAN network....");
}
else if (remoteHostStatus == ReachableViaWiFi){
NSLog(@"Wifi network....");
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With