从Reachability分叉。添加获取移动网络类型(2G/3G/4G)、移动网络运营商(移动/联通/电信/铁通)的功能
self.googleReach = [Reachability reachabilityWithHostname:@"www.google.com"];
self.googleReach.reachableBlock = ^(Reachability * reachability)
{
NSString * temp = [NSString stringWithFormat:@"GOOGLE Block Says Reachable(%@)", reachability.currentReachabilityString];
NSLog(@"%@", temp);
// to update UI components from a block callback
// you need to dipatch this to the main thread
// this uses NSOperationQueue mainQueue
[[NSOperationQueue mainQueue] addOperationWithBlock:^{
weakself.blockLabel.text = temp;
weakself.blockLabel.textColor = [UIColor blackColor];
}];
// 4G 3G 2G WIFI
NSLog(@"%@",[reachability distinguishReachable]);
//Mobile Networks Operator
NSLog(@"%@",[Reachability checkMobileOperators]);
};