I want to know which is the latest and effective method to check internet connection in iOS.Most of the answers in stackoverflow is outdated it seems.I went through REACHABILITY class.It is working fine.But I have a problem.
I have a wifi connection which ask for provider login at times.So the reachability class shows that wifi connection is available however internet is not usable.
so,when I call a url,the activityIndicator that I am using along with the url keeps on spinning and I am getting no callback about the error.Is there a fix?Thanks.
Also,can you explain what these exactly means?
@property (nonatomic) Reachability *hostReachability;
@property (nonatomic) Reachability *internetReachability;
@property (nonatomic) Reachability *wifiReachability;
like,What is wifiReachability?Is it connected to wifi?or internet is available through wifi?
EDIT: This is what I am using now.Creating a class called connectivity
#import "Connectivity.h"
#import "Reachability.h"
@implementation Connectivity
+(BOOL)checkConnectivity
{
Reachability *reachability = [Reachability reachabilityForInternetConnection];
NetworkStatus networkStatus = [reachability currentReachabilityStatus];
return networkStatus != NotReachable;
}
@end
Is this enough to check internetconnection?