iOS 判断网络状态

       判断设备网络状态 Reachability.h Reachability.m文件添加到工程,引入相对应的库文件即可使用,调用方法如下:

+(BOOL)hasNet{
    
    if([Reachability IsEnableWIFI]||[Reachability IsEnable3G]){
    //皆为静态方法,不需新建对象。方便。
        return  YES;
    }
    return NO;
}

文件都在附近中,希望可以帮到需要之人。

猜你喜欢

转载自332016912-qq-com.iteye.com/blog/1973711
今日推荐