Skip to content

Instantly share code, notes, and snippets.

@clooth
Created February 13, 2015 22:56
Show Gist options
  • Save clooth/834081abc79b51029588 to your computer and use it in GitHub Desktop.
Save clooth/834081abc79b51029588 to your computer and use it in GitHub Desktop.
#import <Foundation/Foundation.h>
@interface IOSTools : NSObject
- (NSString *)getCountry;
@end
#import "IOSTools.h"
@import CoreTelephony;
@implementation IOSTools
- (NSString *)getCountry {
CTTelephonyNetworkInfo *networkInfo = [[CTTelephonyNetworkInfo alloc] init];
CTCarrier *carrier = [networkInfo subscriberCellularProvider];
NSString *mcc = [carrier mobileCountryCode];
return mcc;
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment