[[AFNetworkReachabilityManagersharedManager]setReachabilityStatusChangeBlock:^(AFNetworkReachabilityStatusstatus) {
switch(status) {
caseAFNetworkReachabilityStatusNotReachable:
//没有网
//str = @"网络不好,请稍后再试";
[DPAlertHelpershowMessage:@"网络不好,请稍后再试"time:1];
break;
caseAFNetworkReachabilityStatusReachableViaWWAN:
//手机数据
{
//[DPAlertHelper AlertWithTitle:@"提示" Message:@"您正在使用非wifi网络,确定播放" ButtonWithConfirm:@"确定" ClickConfirm:nil ButtonWithCancel:@"取消" clickCancel:^{
//[controller popoverPresentationController];
//}];
}
break;
caseAFNetworkReachabilityStatusReachableViaWiFi:
//wifi数据
{
//[DPAlertHelper AlertWithTitle:@"提示" Message:@"您正在使用非wifi网络,确定播放" ButtonWithConfirm:@"确定" ClickConfirm:nil ButtonWithCancel:@"取消" clickCancel:^{
//[controller popoverPresentationController];
//}];
}
default:
break;
}
}];
[[AFNetworkReachabilityManagersharedManager]startMonitoring];
网友评论