Created
May 29, 2014 11:51
-
-
Save tomhut/4965f0005ed6c262d00e to your computer and use it in GitHub Desktop.
Nice name for current cellular connection technology for iOS 7 and above.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, Thank you for share the .m file. Have header file? I was not found header file in the gist. thank you.