Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save tomhut/4965f0005ed6c262d00e to your computer and use it in GitHub Desktop.
Save tomhut/4965f0005ed6c262d00e to your computer and use it in GitHub Desktop.
Nice name for current cellular connection technology for iOS 7 and above.
//
// CTTelephonyNetworkInfo+CellularConnectionNiceName.m
// Yoyo
//
// Created by Tom Hutchinson on 29/05/2014.
// Copyright (c) 2014 JustYoyoLtd. All rights reserved.
//
#import "CTTelephonyNetworkInfo+CellularConnectionNiceName.h"
@implementation CTTelephonyNetworkInfo (CellularConnectionNiceName)
- (NSString *)cellularConnectionNiceName {
if ([self.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyGPRS]) {
return @"GPRS";
} else if ([self.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyEdge]) {
return @"EDGE";
} else if ([self.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyWCDMA]) {
return @"WCDMA";
} else if ([self.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyHSDPA]) {
return @"HSDPA";
} else if ([self.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyHSUPA]) {
return @"HSUPA";
} else if ([self.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyCDMA1x]) {
return @"CDMA1X";
} else if ([self.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyCDMAEVDORev0]) {
return @"CDMAEVDOREV0";
} else if ([self.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyCDMAEVDORevA]) {
return @"CDMAEVDOREVA";
} else if ([self.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyCDMAEVDORevB]) {
return @"CDMAEVDOREVB";
} else if ([self.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyeHRPD]) {
return @"EHRPD";
} else if ([self.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyLTE]) {
return @"LTE";
}
return @"UNKNOWN";
}
@end
@dickfala
Copy link

Hi, Thank you for share the .m file. Have header file? I was not found header file in the gist. thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment