Created
January 21, 2016 01:59
-
-
Save paulomcnally/0ff0ad18b830b2106863 to your computer and use it in GitHub Desktop.
Swift MCCMNC
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
import Foundation | |
import CoreTelephony | |
class OperatorInfo { | |
func id() -> String { | |
let networkInfo = CTTelephonyNetworkInfo() | |
let carrier = networkInfo.subscriberCellularProvider | |
let mcc = carrier!.mobileCountryCode | |
let mnc = carrier!.mobileNetworkCode | |
return NSString(format: "%@%@", mcc!, mnc!) as String | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment