I know that the reachability example allows detection of whether network is accessible via Wifi or Cell, but is there a way to determine whether the cell connection is over
Marginally simplified version of nst's code to silence compiler warnings I got in XCode 4.5:
- (NSNumber *) dataNetworkTypeFromStatusBar {
UIApplication *app = [UIApplication sharedApplication];
NSArray *subviews = [[[app valueForKey:@"statusBar"] valueForKey:@"foregroundView"] subviews];
NSNumber *dataNetworkItemView = nil;
for (id subview in subviews) {
if([subview isKindOfClass:[NSClassFromString(@"UIStatusBarDataNetworkItemView") class]]) {
dataNetworkItemView = subview;
break;
}
}
return [dataNetworkItemView valueForKey:@"dataNetworkType"];
}
And the value keys I've found so far: