//检测App当前的网络状态
AFNetworkReachabilityManager *manager =[AFNetworkReachabilityManagersharedManager];
// 开始检测网络状态
[manager startMonitoring];
[manager setReachabilityStatusChangeBlock:^(AFNetworkReachabilityStatus status) {
if (status ==AFNetworkReachabilityStatusReachableViaWiFi) {
NSLog(@"WIFI");
}elseif (status ==AFNetworkReachabilityStatusReachableViaWWAN){
}elseif (status ==AFNetworkReachabilityStatusUnknown){
NSLog(@"未知网络");
}elseif (status ==AFNetworkReachabilityStatusNotReachable){
NSLog(@"无网络");
}
}];
// 停止检测网络
[manager stopMonitoring];