this is the header file
#import <CoreTelephony/CTTelephonyNetworkInfo.h>
code
CTTelephonyNetworkInfo *telephonyInfo = [CTTelephonyNetworkInfo new];
NSLog(@"Current Radio Access Technology: %@", telephonyInfo.currentRadioAccessTechnology);
[NSNotificationCenter.defaultCenter addObserverForName:CTRadioAccessTechnologyDidChangeNotification
object:nil
queue:nil
usingBlock:^(NSNotification *note) {
NSLog(@"New Radio Access Technology: %@", telephonyInfo.currentRadioAccessTechnology);
}];
this fast function
- (BOOL)isFast:(NSString*)radioAccessTechnology {
if ([radioAccessTechnology isEqualToString:CTRadioAccessTechnologyGPRS]) {
return NO;
} else if ([radioAccessTechnology isEqualToString:CTRadioAccessTechnologyEdge]) {
return NO;
} else if ([radioAccessTechnology isEqualToString:CTRadioAccessTechnologyWCDMA]) {
return YES;
} else if ([radioAccessTechnology isEqualToString:CTRadioAccessTechnologyHSDPA]) {
return YES;
} else if ([radioAccessTechnology isEqualToString:CTRadioAccessTechnologyHSUPA]) {
return YES;
} else if ([radioAccessTechnology isEqualToString:CTRadioAccessTechnologyCDMA1x]) {
return NO;
} else if ([radioAccessTechnology isEqualToString:CTRadioAccessTechnologyCDMAEVDORev0]) {
return YES;
} else if ([radioAccessTechnology isEqualToString:CTRadioAccessTechnologyCDMAEVDORevA]) {
return YES;
} else if ([radioAccessTechnology isEqualToString:CTRadioAccessTechnologyCDMAEVDORevB]) {
return YES;
} else if ([radioAccessTechnology isEqualToString:CTRadioAccessTechnologyeHRPD]) {
return YES;
} else if ([radioAccessTechnology isEqualToString:CTRadioAccessTechnologyLTE]) {
return YES;
}
return YES;
}
after ios7
2G
CTRadioAccessTechnologyGPRS
CTRadioAccessTechnologyEdge
3G
CTRadioAccessTechnologyWCDMA
CTRadioAccessTechnologyHSDPA
CTRadioAccessTechnologyHSUPA
CTRadioAccessTechnologyCDMA1x
CTRadioAccessTechnologyCDMAEVDORev0
CTRadioAccessTechnologyCDMAEVDORevA
CTRadioAccessTechnologyCDMAEVDORevB
CTRadioAccessTechnologyeHRPD
4G
CTRadioAccessTechnologyLTE