Created
June 14, 2016 14:53
-
-
Save dfelber/7df6923aaade15eae80c52d4f7fa5a6d to your computer and use it in GitHub Desktop.
Get carrier info from your iOS Device
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 CoreTelephony | |
let info: CTTelephonyNetworkInfo = CTTelephonyNetworkInfo() | |
guard let carrier: CTCarrier = info.subscriberCellularProvider else { | |
// No carrier info available | |
return | |
} | |
print(carrier.carrierName) | |
print(carrier.mobileCountryCode) | |
print(carrier.mobileNetworkCode) | |
print(carrier.isoCountryCode) | |
print(carrier.allowsVOIP) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment