Skip to content

Instantly share code, notes, and snippets.

@paulomcnally
Created January 21, 2016 01:59
Show Gist options
  • Save paulomcnally/0ff0ad18b830b2106863 to your computer and use it in GitHub Desktop.
Save paulomcnally/0ff0ad18b830b2106863 to your computer and use it in GitHub Desktop.
Swift MCCMNC
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