Here is my code to check whether internet connection is available or not for application.
-(BOOL)isReachable{
Reachability *r = [Reachability reachabilityWithHostName:@"www.apple.com"];
NetworkStatus internetStatus = [r currentReachabilityStatus];
NSLog(@"internet status------%u",ReachableViaWiFi);
if ((internetStatus != ReachableViaWiFi) && (internetStatus != ReachableViaWWAN))
{
NSLog(@"no net");
//do something for no net connection
return NO;
}
return YES;}
Above code works properly.When wifi is enabled and request send to cloudkit,data appears fast.but when cellular data is enable and request send to cloudkit,it took so much time to load data.So I want to check is there any way to check internet speed before sending request to cloudkit,so that I can inform my user that "it will take time to load data because internet speed is slow."