├── README.md ├── DemoDiallingCode ├── DemoDiallingCode │ ├── MMCountry.m │ ├── MasterViewController.h │ ├── AppDelegate.h │ ├── main.m │ ├── MMCountry.h │ ├── DetailViewController.h │ ├── DetailViewController.m │ ├── Images.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Info.plist │ ├── AppDelegate.m │ ├── Base.lproj │ │ ├── LaunchScreen.xib │ │ └── Main.storyboard │ └── MasterViewController.m ├── DemoDiallingCode.xcodeproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── project.pbxproj ├── DemoDiallingCodeTests │ ├── Info.plist │ └── DemoDiallingCodeTests.m └── diallingcode.json ├── .gitignore └── LICENSE /README.md: -------------------------------------------------------------------------------- 1 | # DemoDiallingCode 2 | Demo shows how to deal with dialling code 3 | -------------------------------------------------------------------------------- /DemoDiallingCode/DemoDiallingCode/MMCountry.m: -------------------------------------------------------------------------------- 1 | // 2 | // MMCountry.m 3 | // 4 | // 5 | // Created by Ralph Li on 8/17/15. 6 | // 7 | // 8 | 9 | #import "MMCountry.h" 10 | 11 | @implementation MMCountry 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /DemoDiallingCode/DemoDiallingCode.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /DemoDiallingCode/DemoDiallingCode/MasterViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // MasterViewController.h 3 | // DemoDiallingCode 4 | // 5 | // Created by Ralph Li on 8/17/15. 6 | // Copyright (c) 2015 LJC. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class DetailViewController; 12 | 13 | @interface MasterViewController : UITableViewController 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /DemoDiallingCode/DemoDiallingCode/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // DemoDiallingCode 4 | // 5 | // Created by Ralph Li on 8/17/15. 6 | // Copyright (c) 2015 LJC. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /DemoDiallingCode/DemoDiallingCode/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // DemoDiallingCode 4 | // 5 | // Created by Ralph Li on 8/17/15. 6 | // Copyright (c) 2015 LJC. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /DemoDiallingCode/DemoDiallingCode/MMCountry.h: -------------------------------------------------------------------------------- 1 | // 2 | // MMCountry.h 3 | // 4 | // 5 | // Created by Ralph Li on 8/17/15. 6 | // 7 | // 8 | 9 | #import 10 | 11 | @interface MMCountry : NSObject 12 | 13 | @property (nonatomic, strong) NSString *name; 14 | @property (nonatomic, strong) NSString *code; 15 | @property (nonatomic, strong) NSString *latin; 16 | @property (nonatomic, strong) NSString *dial_code; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /DemoDiallingCode/DemoDiallingCode/DetailViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // DetailViewController.h 3 | // DemoDiallingCode 4 | // 5 | // Created by Ralph Li on 8/17/15. 6 | // Copyright (c) 2015 LJC. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface DetailViewController : UIViewController 12 | 13 | @property (strong, nonatomic) id detailItem; 14 | @property (weak, nonatomic) IBOutlet UILabel *detailDescriptionLabel; 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | build/ 4 | *.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | xcuserdata 13 | *.xccheckout 14 | *.moved-aside 15 | DerivedData 16 | *.hmap 17 | *.ipa 18 | *.xcuserstate 19 | 20 | # CocoaPods 21 | # 22 | # We recommend against adding the Pods directory to your .gitignore. However 23 | # you should judge for yourself, the pros and cons are mentioned at: 24 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 25 | # 26 | #Pods/ 27 | -------------------------------------------------------------------------------- /DemoDiallingCode/DemoDiallingCodeTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.adad184.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /DemoDiallingCode/DemoDiallingCodeTests/DemoDiallingCodeTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // DemoDiallingCodeTests.m 3 | // DemoDiallingCodeTests 4 | // 5 | // Created by Ralph Li on 8/17/15. 6 | // Copyright (c) 2015 LJC. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface DemoDiallingCodeTests : XCTestCase 13 | 14 | @end 15 | 16 | @implementation DemoDiallingCodeTests 17 | 18 | - (void)setUp { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown { 24 | // Put teardown code here. This method is called after the invocation of each test method in the class. 25 | [super tearDown]; 26 | } 27 | 28 | - (void)testExample { 29 | // This is an example of a functional test case. 30 | XCTAssert(YES, @"Pass"); 31 | } 32 | 33 | - (void)testPerformanceExample { 34 | // This is an example of a performance test case. 35 | [self measureBlock:^{ 36 | // Put the code you want to measure the time of here. 37 | }]; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 ralph li 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /DemoDiallingCode/DemoDiallingCode/DetailViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // DetailViewController.m 3 | // DemoDiallingCode 4 | // 5 | // Created by Ralph Li on 8/17/15. 6 | // Copyright (c) 2015 LJC. All rights reserved. 7 | // 8 | 9 | #import "DetailViewController.h" 10 | 11 | @interface DetailViewController () 12 | 13 | @end 14 | 15 | @implementation DetailViewController 16 | 17 | #pragma mark - Managing the detail item 18 | 19 | - (void)setDetailItem:(id)newDetailItem { 20 | if (_detailItem != newDetailItem) { 21 | _detailItem = newDetailItem; 22 | 23 | // Update the view. 24 | [self configureView]; 25 | } 26 | } 27 | 28 | - (void)configureView { 29 | // Update the user interface for the detail item. 30 | if (self.detailItem) { 31 | self.detailDescriptionLabel.text = [self.detailItem description]; 32 | } 33 | } 34 | 35 | - (void)viewDidLoad { 36 | [super viewDidLoad]; 37 | // Do any additional setup after loading the view, typically from a nib. 38 | [self configureView]; 39 | } 40 | 41 | - (void)didReceiveMemoryWarning { 42 | [super didReceiveMemoryWarning]; 43 | // Dispose of any resources that can be recreated. 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /DemoDiallingCode/DemoDiallingCode/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /DemoDiallingCode/DemoDiallingCode/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.adad184.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UIStatusBarTintParameters 34 | 35 | UINavigationBar 36 | 37 | Style 38 | UIBarStyleDefault 39 | Translucent 40 | 41 | 42 | 43 | UISupportedInterfaceOrientations 44 | 45 | UIInterfaceOrientationPortrait 46 | UIInterfaceOrientationLandscapeLeft 47 | UIInterfaceOrientationLandscapeRight 48 | 49 | UISupportedInterfaceOrientations~ipad 50 | 51 | UIInterfaceOrientationPortrait 52 | UIInterfaceOrientationPortraitUpsideDown 53 | UIInterfaceOrientationLandscapeLeft 54 | UIInterfaceOrientationLandscapeRight 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /DemoDiallingCode/DemoDiallingCode/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // DemoDiallingCode 4 | // 5 | // Created by Ralph Li on 8/17/15. 6 | // Copyright (c) 2015 LJC. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import "DetailViewController.h" 11 | 12 | @interface AppDelegate () 13 | 14 | @end 15 | 16 | @implementation AppDelegate 17 | 18 | 19 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 20 | // Override point for customization after application launch. 21 | UISplitViewController *splitViewController = (UISplitViewController *)self.window.rootViewController; 22 | UINavigationController *navigationController = [splitViewController.viewControllers lastObject]; 23 | navigationController.topViewController.navigationItem.leftBarButtonItem = splitViewController.displayModeButtonItem; 24 | splitViewController.delegate = self; 25 | return YES; 26 | } 27 | 28 | - (void)applicationWillResignActive:(UIApplication *)application { 29 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 30 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 31 | } 32 | 33 | - (void)applicationDidEnterBackground:(UIApplication *)application { 34 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 35 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 36 | } 37 | 38 | - (void)applicationWillEnterForeground:(UIApplication *)application { 39 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 40 | } 41 | 42 | - (void)applicationDidBecomeActive:(UIApplication *)application { 43 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 44 | } 45 | 46 | - (void)applicationWillTerminate:(UIApplication *)application { 47 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 48 | } 49 | 50 | #pragma mark - Split view 51 | 52 | - (BOOL)splitViewController:(UISplitViewController *)splitViewController collapseSecondaryViewController:(UIViewController *)secondaryViewController ontoPrimaryViewController:(UIViewController *)primaryViewController { 53 | if ([secondaryViewController isKindOfClass:[UINavigationController class]] && [[(UINavigationController *)secondaryViewController topViewController] isKindOfClass:[DetailViewController class]] && ([(DetailViewController *)[(UINavigationController *)secondaryViewController topViewController] detailItem] == nil)) { 54 | // Return YES to indicate that we have handled the collapse by doing nothing; the secondary controller will be discarded. 55 | return YES; 56 | } else { 57 | return NO; 58 | } 59 | } 60 | 61 | @end 62 | -------------------------------------------------------------------------------- /DemoDiallingCode/DemoDiallingCode/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 20 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /DemoDiallingCode/DemoDiallingCode/MasterViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // MasterViewController.m 3 | // DemoDiallingCode 4 | // 5 | // Created by Ralph Li on 8/17/15. 6 | // Copyright (c) 2015 LJC. All rights reserved. 7 | // 8 | 9 | #import "MasterViewController.h" 10 | #import "MMCountry.h" 11 | 12 | @interface MasterViewController () 13 | 14 | @property NSMutableArray *objects; 15 | @property NSMutableDictionary *dicCode; 16 | 17 | @end 18 | 19 | @implementation MasterViewController 20 | 21 | - (void)awakeFromNib { 22 | [super awakeFromNib]; 23 | if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) { 24 | self.clearsSelectionOnViewWillAppear = NO; 25 | self.preferredContentSize = CGSizeMake(320.0, 600.0); 26 | } 27 | } 28 | 29 | - (void)viewDidLoad { 30 | [super viewDidLoad]; 31 | // Do any additional setup after loading the view, typically from a nib. 32 | 33 | self.tableView.sectionIndexBackgroundColor = [UIColor clearColor]; 34 | 35 | [self readData]; 36 | } 37 | 38 | - (void)readData { 39 | 40 | 41 | NSData *data = [NSData dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"diallingcode" ofType:@"json"]]; 42 | NSError *error = nil; 43 | 44 | NSArray *arrayCode = [NSJSONSerialization JSONObjectWithData:data options:0 error:&error]; 45 | 46 | if ( error ) { 47 | 48 | return; 49 | } 50 | NSLog(@"%@", arrayCode); 51 | 52 | 53 | //读取文件 54 | NSMutableDictionary *dicCode = [@{} mutableCopy]; 55 | 56 | for ( NSDictionary *item in arrayCode ) 57 | { 58 | MMCountry *c = [MMCountry new]; 59 | 60 | c.code = item[@"code"]; 61 | c.dial_code = item[@"dial_code"]; 62 | 63 | [dicCode setObject:c forKey:c.code]; 64 | } 65 | 66 | //获取国家名 67 | NSLocale *locale = [NSLocale currentLocale]; 68 | NSArray *countryArray = [NSLocale ISOCountryCodes]; 69 | 70 | NSMutableDictionary *dicCountry = [@{} mutableCopy]; 71 | 72 | for (NSString *countryCode in countryArray) { 73 | 74 | if ( dicCode[countryCode] ) 75 | { 76 | MMCountry *c = dicCode[countryCode]; 77 | 78 | c.name = [locale displayNameForKey:NSLocaleCountryCode value:countryCode]; 79 | if ( [c.name isEqualToString:@"台湾"] ) 80 | { 81 | c.name = @"中国台湾"; 82 | } 83 | 84 | c.latin = [self latinize:c.name]; 85 | 86 | [dicCountry setObject:c forKey:c.code]; 87 | } 88 | else 89 | { 90 | NSLog(@"++ %@ %@",[locale displayNameForKey:NSLocaleCountryCode value:countryCode],countryCode); 91 | } 92 | } 93 | 94 | //归类 95 | NSMutableDictionary *dicSort = [@{} mutableCopy]; 96 | 97 | for ( MMCountry *c in dicCountry.allValues ) 98 | { 99 | NSString *indexKey = @""; 100 | 101 | if ( c.latin.length > 0 ) 102 | { 103 | indexKey = [[c.latin substringToIndex:1] uppercaseString]; 104 | 105 | char c = [indexKey characterAtIndex:0]; 106 | 107 | if ( ( c < 'A') || ( c > 'Z' ) ) 108 | { 109 | continue; 110 | } 111 | } 112 | else 113 | { 114 | continue; 115 | } 116 | 117 | NSMutableArray *array = dicSort[indexKey]; 118 | 119 | if ( !array ) 120 | { 121 | array = [NSMutableArray array]; 122 | 123 | dicSort[indexKey] = array; 124 | } 125 | 126 | [array addObject:c]; 127 | } 128 | 129 | //排序 130 | 131 | for ( NSString *key in dicSort.allKeys ) 132 | { 133 | NSArray *array = dicSort[key]; 134 | 135 | array = [array sortedArrayUsingComparator:^NSComparisonResult(MMCountry *obj1, MMCountry *obj2) { 136 | 137 | return [obj1.name localizedStandardCompare:obj2.name]; 138 | }]; 139 | 140 | // array = [array sortedArrayUsingComparator:^NSComparisonResult(CSCountry *obj1, CSCountry *obj2) { 141 | // 142 | // return obj1.sortKey > obj2.sortKey; 143 | // }]; 144 | 145 | dicSort[key] = array; 146 | } 147 | 148 | self.dicCode = dicSort; 149 | 150 | 151 | [self.tableView reloadData]; 152 | 153 | } 154 | 155 | - (void)didReceiveMemoryWarning { 156 | [super didReceiveMemoryWarning]; 157 | // Dispose of any resources that can be recreated. 158 | } 159 | 160 | - (void)insertNewObject:(id)sender { 161 | if (!self.objects) { 162 | self.objects = [[NSMutableArray alloc] init]; 163 | } 164 | [self.objects insertObject:[NSDate date] atIndex:0]; 165 | NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:0]; 166 | [self.tableView insertRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationAutomatic]; 167 | } 168 | 169 | 170 | #pragma mark - Table View 171 | 172 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { 173 | return 26; 174 | } 175 | 176 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 177 | 178 | NSArray *array = self.dicCode[[NSString stringWithFormat:@"%c",(char)('A'+section)]]; 179 | 180 | return array.count; 181 | } 182 | 183 | - (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView 184 | { 185 | NSMutableArray *indexArray = [@[] mutableCopy]; 186 | 187 | for ( int i = 0 ; i < 26 ; ++i ) 188 | { 189 | NSString *index = [NSString stringWithFormat:@"%c",(char)('A'+i)]; 190 | NSArray *array = self.dicCode[index]; 191 | 192 | if ( array.count > 0 ) 193 | { 194 | [indexArray addObject:index]; 195 | } 196 | } 197 | 198 | return indexArray; 199 | } 200 | 201 | - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section 202 | { 203 | if ( tableView != self.tableView ) 204 | { 205 | return nil; 206 | } 207 | 208 | UILabel *header = [tableView dequeueReusableHeaderFooterViewWithIdentifier:@"section"]; 209 | 210 | if ( !header ) 211 | { 212 | header = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, tableView.frame.size.width, 30)]; 213 | header.textAlignment = NSTextAlignmentLeft; 214 | header.textColor = [UIColor blackColor]; 215 | header.backgroundColor = [UIColor colorWithRed:0.9 green:0.9 blue:0.9 alpha:1.0]; 216 | header.font = [UIFont boldSystemFontOfSize:14]; 217 | } 218 | 219 | header.text = [NSString stringWithFormat:@" %c",(char)('A'+section)]; 220 | 221 | return header; 222 | } 223 | 224 | - (NSInteger)tableView:(UITableView *)tableView sectionForSectionIndexTitle:(NSString *)title atIndex:(NSInteger)index 225 | { 226 | char firstChar = [title characterAtIndex:0]; 227 | return firstChar - 'A'; 228 | } 229 | 230 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 231 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell" forIndexPath:indexPath]; 232 | 233 | 234 | NSArray *array = self.dicCode[[NSString stringWithFormat:@"%c",(char)('A'+indexPath.section)]]; 235 | 236 | MMCountry *c = array[indexPath.row]; 237 | 238 | cell.textLabel.text = c.name; 239 | cell.detailTextLabel.text = c.dial_code; 240 | 241 | return cell; 242 | } 243 | 244 | - (NSString*)latinize:(NSString*)str 245 | { 246 | NSMutableString *source = [str mutableCopy]; 247 | 248 | CFStringTransform((__bridge CFMutableStringRef)source, NULL, kCFStringTransformToLatin, NO); 249 | // CFStringTransform((__bridge CFMutableStringRef)source, NULL, kCFStringTransformMandarinLatin, NO); 250 | 251 | CFStringTransform((__bridge CFMutableStringRef)source, NULL, kCFStringTransformStripDiacritics, NO); 252 | 253 | return source; 254 | } 255 | 256 | 257 | 258 | @end 259 | -------------------------------------------------------------------------------- /DemoDiallingCode/DemoDiallingCode/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | -------------------------------------------------------------------------------- /DemoDiallingCode/DemoDiallingCode.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | ED878D611B818AAE008C0135 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = ED878D601B818AAE008C0135 /* main.m */; }; 11 | ED878D641B818AAE008C0135 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = ED878D631B818AAE008C0135 /* AppDelegate.m */; }; 12 | ED878D671B818AAE008C0135 /* MasterViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = ED878D661B818AAE008C0135 /* MasterViewController.m */; }; 13 | ED878D6A1B818AAE008C0135 /* DetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = ED878D691B818AAE008C0135 /* DetailViewController.m */; }; 14 | ED878D6D1B818AAE008C0135 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = ED878D6B1B818AAE008C0135 /* Main.storyboard */; }; 15 | ED878D6F1B818AAE008C0135 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = ED878D6E1B818AAE008C0135 /* Images.xcassets */; }; 16 | ED878D721B818AAE008C0135 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = ED878D701B818AAE008C0135 /* LaunchScreen.xib */; }; 17 | ED878D7E1B818AAE008C0135 /* DemoDiallingCodeTests.m in Sources */ = {isa = PBXBuildFile; fileRef = ED878D7D1B818AAE008C0135 /* DemoDiallingCodeTests.m */; }; 18 | ED878D881B818B76008C0135 /* diallingcode.json in Resources */ = {isa = PBXBuildFile; fileRef = ED878D871B818B76008C0135 /* diallingcode.json */; }; 19 | ED878D8B1B818BA3008C0135 /* MMCountry.m in Sources */ = {isa = PBXBuildFile; fileRef = ED878D8A1B818BA3008C0135 /* MMCountry.m */; }; 20 | /* End PBXBuildFile section */ 21 | 22 | /* Begin PBXContainerItemProxy section */ 23 | ED878D781B818AAE008C0135 /* PBXContainerItemProxy */ = { 24 | isa = PBXContainerItemProxy; 25 | containerPortal = ED878D531B818AAE008C0135 /* Project object */; 26 | proxyType = 1; 27 | remoteGlobalIDString = ED878D5A1B818AAE008C0135; 28 | remoteInfo = DemoDiallingCode; 29 | }; 30 | /* End PBXContainerItemProxy section */ 31 | 32 | /* Begin PBXFileReference section */ 33 | ED878D5B1B818AAE008C0135 /* DemoDiallingCode.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DemoDiallingCode.app; sourceTree = BUILT_PRODUCTS_DIR; }; 34 | ED878D5F1B818AAE008C0135 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 35 | ED878D601B818AAE008C0135 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 36 | ED878D621B818AAE008C0135 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 37 | ED878D631B818AAE008C0135 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 38 | ED878D651B818AAE008C0135 /* MasterViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MasterViewController.h; sourceTree = ""; }; 39 | ED878D661B818AAE008C0135 /* MasterViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MasterViewController.m; sourceTree = ""; }; 40 | ED878D681B818AAE008C0135 /* DetailViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DetailViewController.h; sourceTree = ""; }; 41 | ED878D691B818AAE008C0135 /* DetailViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DetailViewController.m; sourceTree = ""; }; 42 | ED878D6C1B818AAE008C0135 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 43 | ED878D6E1B818AAE008C0135 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 44 | ED878D711B818AAE008C0135 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 45 | ED878D771B818AAE008C0135 /* DemoDiallingCodeTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = DemoDiallingCodeTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 46 | ED878D7C1B818AAE008C0135 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 47 | ED878D7D1B818AAE008C0135 /* DemoDiallingCodeTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DemoDiallingCodeTests.m; sourceTree = ""; }; 48 | ED878D871B818B76008C0135 /* diallingcode.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = diallingcode.json; sourceTree = SOURCE_ROOT; }; 49 | ED878D891B818BA3008C0135 /* MMCountry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMCountry.h; sourceTree = ""; }; 50 | ED878D8A1B818BA3008C0135 /* MMCountry.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMCountry.m; sourceTree = ""; }; 51 | /* End PBXFileReference section */ 52 | 53 | /* Begin PBXFrameworksBuildPhase section */ 54 | ED878D581B818AAE008C0135 /* Frameworks */ = { 55 | isa = PBXFrameworksBuildPhase; 56 | buildActionMask = 2147483647; 57 | files = ( 58 | ); 59 | runOnlyForDeploymentPostprocessing = 0; 60 | }; 61 | ED878D741B818AAE008C0135 /* Frameworks */ = { 62 | isa = PBXFrameworksBuildPhase; 63 | buildActionMask = 2147483647; 64 | files = ( 65 | ); 66 | runOnlyForDeploymentPostprocessing = 0; 67 | }; 68 | /* End PBXFrameworksBuildPhase section */ 69 | 70 | /* Begin PBXGroup section */ 71 | ED878D521B818AAE008C0135 = { 72 | isa = PBXGroup; 73 | children = ( 74 | ED878D5D1B818AAE008C0135 /* DemoDiallingCode */, 75 | ED878D7A1B818AAE008C0135 /* DemoDiallingCodeTests */, 76 | ED878D5C1B818AAE008C0135 /* Products */, 77 | ); 78 | sourceTree = ""; 79 | }; 80 | ED878D5C1B818AAE008C0135 /* Products */ = { 81 | isa = PBXGroup; 82 | children = ( 83 | ED878D5B1B818AAE008C0135 /* DemoDiallingCode.app */, 84 | ED878D771B818AAE008C0135 /* DemoDiallingCodeTests.xctest */, 85 | ); 86 | name = Products; 87 | sourceTree = ""; 88 | }; 89 | ED878D5D1B818AAE008C0135 /* DemoDiallingCode */ = { 90 | isa = PBXGroup; 91 | children = ( 92 | ED878D891B818BA3008C0135 /* MMCountry.h */, 93 | ED878D8A1B818BA3008C0135 /* MMCountry.m */, 94 | ED878D621B818AAE008C0135 /* AppDelegate.h */, 95 | ED878D631B818AAE008C0135 /* AppDelegate.m */, 96 | ED878D651B818AAE008C0135 /* MasterViewController.h */, 97 | ED878D661B818AAE008C0135 /* MasterViewController.m */, 98 | ED878D681B818AAE008C0135 /* DetailViewController.h */, 99 | ED878D691B818AAE008C0135 /* DetailViewController.m */, 100 | ED878D6B1B818AAE008C0135 /* Main.storyboard */, 101 | ED878D871B818B76008C0135 /* diallingcode.json */, 102 | ED878D6E1B818AAE008C0135 /* Images.xcassets */, 103 | ED878D701B818AAE008C0135 /* LaunchScreen.xib */, 104 | ED878D5E1B818AAE008C0135 /* Supporting Files */, 105 | ); 106 | path = DemoDiallingCode; 107 | sourceTree = ""; 108 | }; 109 | ED878D5E1B818AAE008C0135 /* Supporting Files */ = { 110 | isa = PBXGroup; 111 | children = ( 112 | ED878D5F1B818AAE008C0135 /* Info.plist */, 113 | ED878D601B818AAE008C0135 /* main.m */, 114 | ); 115 | name = "Supporting Files"; 116 | sourceTree = ""; 117 | }; 118 | ED878D7A1B818AAE008C0135 /* DemoDiallingCodeTests */ = { 119 | isa = PBXGroup; 120 | children = ( 121 | ED878D7D1B818AAE008C0135 /* DemoDiallingCodeTests.m */, 122 | ED878D7B1B818AAE008C0135 /* Supporting Files */, 123 | ); 124 | path = DemoDiallingCodeTests; 125 | sourceTree = ""; 126 | }; 127 | ED878D7B1B818AAE008C0135 /* Supporting Files */ = { 128 | isa = PBXGroup; 129 | children = ( 130 | ED878D7C1B818AAE008C0135 /* Info.plist */, 131 | ); 132 | name = "Supporting Files"; 133 | sourceTree = ""; 134 | }; 135 | /* End PBXGroup section */ 136 | 137 | /* Begin PBXNativeTarget section */ 138 | ED878D5A1B818AAE008C0135 /* DemoDiallingCode */ = { 139 | isa = PBXNativeTarget; 140 | buildConfigurationList = ED878D811B818AAE008C0135 /* Build configuration list for PBXNativeTarget "DemoDiallingCode" */; 141 | buildPhases = ( 142 | ED878D571B818AAE008C0135 /* Sources */, 143 | ED878D581B818AAE008C0135 /* Frameworks */, 144 | ED878D591B818AAE008C0135 /* Resources */, 145 | ); 146 | buildRules = ( 147 | ); 148 | dependencies = ( 149 | ); 150 | name = DemoDiallingCode; 151 | productName = DemoDiallingCode; 152 | productReference = ED878D5B1B818AAE008C0135 /* DemoDiallingCode.app */; 153 | productType = "com.apple.product-type.application"; 154 | }; 155 | ED878D761B818AAE008C0135 /* DemoDiallingCodeTests */ = { 156 | isa = PBXNativeTarget; 157 | buildConfigurationList = ED878D841B818AAE008C0135 /* Build configuration list for PBXNativeTarget "DemoDiallingCodeTests" */; 158 | buildPhases = ( 159 | ED878D731B818AAE008C0135 /* Sources */, 160 | ED878D741B818AAE008C0135 /* Frameworks */, 161 | ED878D751B818AAE008C0135 /* Resources */, 162 | ); 163 | buildRules = ( 164 | ); 165 | dependencies = ( 166 | ED878D791B818AAE008C0135 /* PBXTargetDependency */, 167 | ); 168 | name = DemoDiallingCodeTests; 169 | productName = DemoDiallingCodeTests; 170 | productReference = ED878D771B818AAE008C0135 /* DemoDiallingCodeTests.xctest */; 171 | productType = "com.apple.product-type.bundle.unit-test"; 172 | }; 173 | /* End PBXNativeTarget section */ 174 | 175 | /* Begin PBXProject section */ 176 | ED878D531B818AAE008C0135 /* Project object */ = { 177 | isa = PBXProject; 178 | attributes = { 179 | LastUpgradeCheck = 0640; 180 | ORGANIZATIONNAME = LJC; 181 | TargetAttributes = { 182 | ED878D5A1B818AAE008C0135 = { 183 | CreatedOnToolsVersion = 6.4; 184 | }; 185 | ED878D761B818AAE008C0135 = { 186 | CreatedOnToolsVersion = 6.4; 187 | TestTargetID = ED878D5A1B818AAE008C0135; 188 | }; 189 | }; 190 | }; 191 | buildConfigurationList = ED878D561B818AAE008C0135 /* Build configuration list for PBXProject "DemoDiallingCode" */; 192 | compatibilityVersion = "Xcode 3.2"; 193 | developmentRegion = English; 194 | hasScannedForEncodings = 0; 195 | knownRegions = ( 196 | en, 197 | Base, 198 | ); 199 | mainGroup = ED878D521B818AAE008C0135; 200 | productRefGroup = ED878D5C1B818AAE008C0135 /* Products */; 201 | projectDirPath = ""; 202 | projectRoot = ""; 203 | targets = ( 204 | ED878D5A1B818AAE008C0135 /* DemoDiallingCode */, 205 | ED878D761B818AAE008C0135 /* DemoDiallingCodeTests */, 206 | ); 207 | }; 208 | /* End PBXProject section */ 209 | 210 | /* Begin PBXResourcesBuildPhase section */ 211 | ED878D591B818AAE008C0135 /* Resources */ = { 212 | isa = PBXResourcesBuildPhase; 213 | buildActionMask = 2147483647; 214 | files = ( 215 | ED878D881B818B76008C0135 /* diallingcode.json in Resources */, 216 | ED878D6D1B818AAE008C0135 /* Main.storyboard in Resources */, 217 | ED878D721B818AAE008C0135 /* LaunchScreen.xib in Resources */, 218 | ED878D6F1B818AAE008C0135 /* Images.xcassets in Resources */, 219 | ); 220 | runOnlyForDeploymentPostprocessing = 0; 221 | }; 222 | ED878D751B818AAE008C0135 /* Resources */ = { 223 | isa = PBXResourcesBuildPhase; 224 | buildActionMask = 2147483647; 225 | files = ( 226 | ); 227 | runOnlyForDeploymentPostprocessing = 0; 228 | }; 229 | /* End PBXResourcesBuildPhase section */ 230 | 231 | /* Begin PBXSourcesBuildPhase section */ 232 | ED878D571B818AAE008C0135 /* Sources */ = { 233 | isa = PBXSourcesBuildPhase; 234 | buildActionMask = 2147483647; 235 | files = ( 236 | ED878D641B818AAE008C0135 /* AppDelegate.m in Sources */, 237 | ED878D671B818AAE008C0135 /* MasterViewController.m in Sources */, 238 | ED878D8B1B818BA3008C0135 /* MMCountry.m in Sources */, 239 | ED878D611B818AAE008C0135 /* main.m in Sources */, 240 | ED878D6A1B818AAE008C0135 /* DetailViewController.m in Sources */, 241 | ); 242 | runOnlyForDeploymentPostprocessing = 0; 243 | }; 244 | ED878D731B818AAE008C0135 /* Sources */ = { 245 | isa = PBXSourcesBuildPhase; 246 | buildActionMask = 2147483647; 247 | files = ( 248 | ED878D7E1B818AAE008C0135 /* DemoDiallingCodeTests.m in Sources */, 249 | ); 250 | runOnlyForDeploymentPostprocessing = 0; 251 | }; 252 | /* End PBXSourcesBuildPhase section */ 253 | 254 | /* Begin PBXTargetDependency section */ 255 | ED878D791B818AAE008C0135 /* PBXTargetDependency */ = { 256 | isa = PBXTargetDependency; 257 | target = ED878D5A1B818AAE008C0135 /* DemoDiallingCode */; 258 | targetProxy = ED878D781B818AAE008C0135 /* PBXContainerItemProxy */; 259 | }; 260 | /* End PBXTargetDependency section */ 261 | 262 | /* Begin PBXVariantGroup section */ 263 | ED878D6B1B818AAE008C0135 /* Main.storyboard */ = { 264 | isa = PBXVariantGroup; 265 | children = ( 266 | ED878D6C1B818AAE008C0135 /* Base */, 267 | ); 268 | name = Main.storyboard; 269 | sourceTree = ""; 270 | }; 271 | ED878D701B818AAE008C0135 /* LaunchScreen.xib */ = { 272 | isa = PBXVariantGroup; 273 | children = ( 274 | ED878D711B818AAE008C0135 /* Base */, 275 | ); 276 | name = LaunchScreen.xib; 277 | sourceTree = ""; 278 | }; 279 | /* End PBXVariantGroup section */ 280 | 281 | /* Begin XCBuildConfiguration section */ 282 | ED878D7F1B818AAE008C0135 /* Debug */ = { 283 | isa = XCBuildConfiguration; 284 | buildSettings = { 285 | ALWAYS_SEARCH_USER_PATHS = NO; 286 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 287 | CLANG_CXX_LIBRARY = "libc++"; 288 | CLANG_ENABLE_MODULES = YES; 289 | CLANG_ENABLE_OBJC_ARC = YES; 290 | CLANG_WARN_BOOL_CONVERSION = YES; 291 | CLANG_WARN_CONSTANT_CONVERSION = YES; 292 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 293 | CLANG_WARN_EMPTY_BODY = YES; 294 | CLANG_WARN_ENUM_CONVERSION = YES; 295 | CLANG_WARN_INT_CONVERSION = YES; 296 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 297 | CLANG_WARN_UNREACHABLE_CODE = YES; 298 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 299 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 300 | COPY_PHASE_STRIP = NO; 301 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 302 | ENABLE_STRICT_OBJC_MSGSEND = YES; 303 | GCC_C_LANGUAGE_STANDARD = gnu99; 304 | GCC_DYNAMIC_NO_PIC = NO; 305 | GCC_NO_COMMON_BLOCKS = YES; 306 | GCC_OPTIMIZATION_LEVEL = 0; 307 | GCC_PREPROCESSOR_DEFINITIONS = ( 308 | "DEBUG=1", 309 | "$(inherited)", 310 | ); 311 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 312 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 313 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 314 | GCC_WARN_UNDECLARED_SELECTOR = YES; 315 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 316 | GCC_WARN_UNUSED_FUNCTION = YES; 317 | GCC_WARN_UNUSED_VARIABLE = YES; 318 | IPHONEOS_DEPLOYMENT_TARGET = 8.4; 319 | MTL_ENABLE_DEBUG_INFO = YES; 320 | ONLY_ACTIVE_ARCH = YES; 321 | SDKROOT = iphoneos; 322 | TARGETED_DEVICE_FAMILY = "1,2"; 323 | }; 324 | name = Debug; 325 | }; 326 | ED878D801B818AAE008C0135 /* Release */ = { 327 | isa = XCBuildConfiguration; 328 | buildSettings = { 329 | ALWAYS_SEARCH_USER_PATHS = NO; 330 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 331 | CLANG_CXX_LIBRARY = "libc++"; 332 | CLANG_ENABLE_MODULES = YES; 333 | CLANG_ENABLE_OBJC_ARC = YES; 334 | CLANG_WARN_BOOL_CONVERSION = YES; 335 | CLANG_WARN_CONSTANT_CONVERSION = YES; 336 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 337 | CLANG_WARN_EMPTY_BODY = YES; 338 | CLANG_WARN_ENUM_CONVERSION = YES; 339 | CLANG_WARN_INT_CONVERSION = YES; 340 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 341 | CLANG_WARN_UNREACHABLE_CODE = YES; 342 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 343 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 344 | COPY_PHASE_STRIP = NO; 345 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 346 | ENABLE_NS_ASSERTIONS = NO; 347 | ENABLE_STRICT_OBJC_MSGSEND = YES; 348 | GCC_C_LANGUAGE_STANDARD = gnu99; 349 | GCC_NO_COMMON_BLOCKS = YES; 350 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 351 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 352 | GCC_WARN_UNDECLARED_SELECTOR = YES; 353 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 354 | GCC_WARN_UNUSED_FUNCTION = YES; 355 | GCC_WARN_UNUSED_VARIABLE = YES; 356 | IPHONEOS_DEPLOYMENT_TARGET = 8.4; 357 | MTL_ENABLE_DEBUG_INFO = NO; 358 | SDKROOT = iphoneos; 359 | TARGETED_DEVICE_FAMILY = "1,2"; 360 | VALIDATE_PRODUCT = YES; 361 | }; 362 | name = Release; 363 | }; 364 | ED878D821B818AAE008C0135 /* Debug */ = { 365 | isa = XCBuildConfiguration; 366 | buildSettings = { 367 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 368 | INFOPLIST_FILE = DemoDiallingCode/Info.plist; 369 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 370 | PRODUCT_NAME = "$(TARGET_NAME)"; 371 | }; 372 | name = Debug; 373 | }; 374 | ED878D831B818AAE008C0135 /* Release */ = { 375 | isa = XCBuildConfiguration; 376 | buildSettings = { 377 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 378 | INFOPLIST_FILE = DemoDiallingCode/Info.plist; 379 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 380 | PRODUCT_NAME = "$(TARGET_NAME)"; 381 | }; 382 | name = Release; 383 | }; 384 | ED878D851B818AAE008C0135 /* Debug */ = { 385 | isa = XCBuildConfiguration; 386 | buildSettings = { 387 | BUNDLE_LOADER = "$(TEST_HOST)"; 388 | FRAMEWORK_SEARCH_PATHS = ( 389 | "$(SDKROOT)/Developer/Library/Frameworks", 390 | "$(inherited)", 391 | ); 392 | GCC_PREPROCESSOR_DEFINITIONS = ( 393 | "DEBUG=1", 394 | "$(inherited)", 395 | ); 396 | INFOPLIST_FILE = DemoDiallingCodeTests/Info.plist; 397 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 398 | PRODUCT_NAME = "$(TARGET_NAME)"; 399 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/DemoDiallingCode.app/DemoDiallingCode"; 400 | }; 401 | name = Debug; 402 | }; 403 | ED878D861B818AAE008C0135 /* Release */ = { 404 | isa = XCBuildConfiguration; 405 | buildSettings = { 406 | BUNDLE_LOADER = "$(TEST_HOST)"; 407 | FRAMEWORK_SEARCH_PATHS = ( 408 | "$(SDKROOT)/Developer/Library/Frameworks", 409 | "$(inherited)", 410 | ); 411 | INFOPLIST_FILE = DemoDiallingCodeTests/Info.plist; 412 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 413 | PRODUCT_NAME = "$(TARGET_NAME)"; 414 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/DemoDiallingCode.app/DemoDiallingCode"; 415 | }; 416 | name = Release; 417 | }; 418 | /* End XCBuildConfiguration section */ 419 | 420 | /* Begin XCConfigurationList section */ 421 | ED878D561B818AAE008C0135 /* Build configuration list for PBXProject "DemoDiallingCode" */ = { 422 | isa = XCConfigurationList; 423 | buildConfigurations = ( 424 | ED878D7F1B818AAE008C0135 /* Debug */, 425 | ED878D801B818AAE008C0135 /* Release */, 426 | ); 427 | defaultConfigurationIsVisible = 0; 428 | defaultConfigurationName = Release; 429 | }; 430 | ED878D811B818AAE008C0135 /* Build configuration list for PBXNativeTarget "DemoDiallingCode" */ = { 431 | isa = XCConfigurationList; 432 | buildConfigurations = ( 433 | ED878D821B818AAE008C0135 /* Debug */, 434 | ED878D831B818AAE008C0135 /* Release */, 435 | ); 436 | defaultConfigurationIsVisible = 0; 437 | }; 438 | ED878D841B818AAE008C0135 /* Build configuration list for PBXNativeTarget "DemoDiallingCodeTests" */ = { 439 | isa = XCConfigurationList; 440 | buildConfigurations = ( 441 | ED878D851B818AAE008C0135 /* Debug */, 442 | ED878D861B818AAE008C0135 /* Release */, 443 | ); 444 | defaultConfigurationIsVisible = 0; 445 | }; 446 | /* End XCConfigurationList section */ 447 | }; 448 | rootObject = ED878D531B818AAE008C0135 /* Project object */; 449 | } 450 | -------------------------------------------------------------------------------- /DemoDiallingCode/diallingcode.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "Afghanistan", 4 | "dial_code": "+93", 5 | "code": "AF" 6 | }, 7 | { 8 | "name": "Albania", 9 | "dial_code": "+355", 10 | "code": "AL" 11 | }, 12 | { 13 | "name": "Algeria", 14 | "dial_code": "+213", 15 | "code": "DZ" 16 | }, 17 | { 18 | "name": "AmericanSamoa", 19 | "dial_code": "+1 684", 20 | "code": "AS" 21 | }, 22 | { 23 | "name": "Andorra", 24 | "dial_code": "+376", 25 | "code": "AD" 26 | }, 27 | { 28 | "name": "Angola", 29 | "dial_code": "+244", 30 | "code": "AO" 31 | }, 32 | { 33 | "name": "Anguilla", 34 | "dial_code": "+1 264", 35 | "code": "AI" 36 | }, 37 | { 38 | "name": "Antigua and Barbuda", 39 | "dial_code": "+1268", 40 | "code": "AG" 41 | }, 42 | { 43 | "name": "Argentina", 44 | "dial_code": "+54", 45 | "code": "AR" 46 | }, 47 | { 48 | "name": "Armenia", 49 | "dial_code": "+374", 50 | "code": "AM" 51 | }, 52 | { 53 | "name": "Aruba", 54 | "dial_code": "+297", 55 | "code": "AW" 56 | }, 57 | { 58 | "name": "Australia", 59 | "dial_code": "+61", 60 | "code": "AU" 61 | }, 62 | { 63 | "name": "Austria", 64 | "dial_code": "+43", 65 | "code": "AT" 66 | }, 67 | { 68 | "name": "Azerbaijan", 69 | "dial_code": "+994", 70 | "code": "AZ" 71 | }, 72 | { 73 | "name": "Bahamas", 74 | "dial_code": "+1 242", 75 | "code": "BS" 76 | }, 77 | { 78 | "name": "Bahrain", 79 | "dial_code": "+973", 80 | "code": "BH" 81 | }, 82 | { 83 | "name": "Bangladesh", 84 | "dial_code": "+880", 85 | "code": "BD" 86 | }, 87 | { 88 | "name": "Barbados", 89 | "dial_code": "+1 246", 90 | "code": "BB" 91 | }, 92 | { 93 | "name": "Belarus", 94 | "dial_code": "+375", 95 | "code": "BY" 96 | }, 97 | { 98 | "name": "Belgium", 99 | "dial_code": "+32", 100 | "code": "BE" 101 | }, 102 | { 103 | "name": "Belize", 104 | "dial_code": "+501", 105 | "code": "BZ" 106 | }, 107 | { 108 | "name": "Benin", 109 | "dial_code": "+229", 110 | "code": "BJ" 111 | }, 112 | { 113 | "name": "Bermuda", 114 | "dial_code": "+1 441", 115 | "code": "BM" 116 | }, 117 | { 118 | "name": "Bhutan", 119 | "dial_code": "+975", 120 | "code": "BT" 121 | }, 122 | { 123 | "name": "Bosnia and Herzegovina", 124 | "dial_code": "+387", 125 | "code": "BA" 126 | }, 127 | { 128 | "name": "Botswana", 129 | "dial_code": "+267", 130 | "code": "BW" 131 | }, 132 | { 133 | "name": "Brazil", 134 | "dial_code": "+55", 135 | "code": "BR" 136 | }, 137 | { 138 | "name": "British Indian Ocean Territory", 139 | "dial_code": "+246", 140 | "code": "IO" 141 | }, 142 | { 143 | "name": "Bulgaria", 144 | "dial_code": "+359", 145 | "code": "BG" 146 | }, 147 | { 148 | "name": "Burkina Faso", 149 | "dial_code": "+226", 150 | "code": "BF" 151 | }, 152 | { 153 | "name": "Burundi", 154 | "dial_code": "+257", 155 | "code": "BI" 156 | }, 157 | { 158 | "name": "Cambodia", 159 | "dial_code": "+855", 160 | "code": "KH" 161 | }, 162 | { 163 | "name": "Cameroon", 164 | "dial_code": "+237", 165 | "code": "CM" 166 | }, 167 | { 168 | "name": "Canada", 169 | "dial_code": "+1", 170 | "code": "CA" 171 | }, 172 | { 173 | "name": "Cape Verde", 174 | "dial_code": "+238", 175 | "code": "CV" 176 | }, 177 | { 178 | "name": "Cayman Islands", 179 | "dial_code": "+ 345", 180 | "code": "KY" 181 | }, 182 | { 183 | "name": "Central African Republic", 184 | "dial_code": "+236", 185 | "code": "CF" 186 | }, 187 | { 188 | "name": "Chad", 189 | "dial_code": "+235", 190 | "code": "TD" 191 | }, 192 | { 193 | "name": "Chile", 194 | "dial_code": "+56", 195 | "code": "CL" 196 | }, 197 | { 198 | "name": "China", 199 | "dial_code": "+86", 200 | "code": "CN" 201 | }, 202 | { 203 | "name": "Christmas Island", 204 | "dial_code": "+61", 205 | "code": "CX" 206 | }, 207 | { 208 | "name": "Colombia", 209 | "dial_code": "+57", 210 | "code": "CO" 211 | }, 212 | { 213 | "name": "Comoros", 214 | "dial_code": "+269", 215 | "code": "KM" 216 | }, 217 | { 218 | "name": "Congo", 219 | "dial_code": "+242", 220 | "code": "CG" 221 | }, 222 | { 223 | "name": "Cook Islands", 224 | "dial_code": "+682", 225 | "code": "CK" 226 | }, 227 | { 228 | "name": "Costa Rica", 229 | "dial_code": "+506", 230 | "code": "CR" 231 | }, 232 | { 233 | "name": "Croatia", 234 | "dial_code": "+385", 235 | "code": "HR" 236 | }, 237 | { 238 | "name": "Cuba", 239 | "dial_code": "+53", 240 | "code": "CU" 241 | }, 242 | { 243 | "name": "Cyprus", 244 | "dial_code": "+537", 245 | "code": "CY" 246 | }, 247 | { 248 | "name": "Czech Republic", 249 | "dial_code": "+420", 250 | "code": "CZ" 251 | }, 252 | { 253 | "name": "Denmark", 254 | "dial_code": "+45", 255 | "code": "DK" 256 | }, 257 | { 258 | "name": "Djibouti", 259 | "dial_code": "+253", 260 | "code": "DJ" 261 | }, 262 | { 263 | "name": "Dominica", 264 | "dial_code": "+1 767", 265 | "code": "DM" 266 | }, 267 | { 268 | "name": "Dominican Republic", 269 | "dial_code": "+1 849", 270 | "code": "DO" 271 | }, 272 | { 273 | "name": "Ecuador", 274 | "dial_code": "+593", 275 | "code": "EC" 276 | }, 277 | { 278 | "name": "Egypt", 279 | "dial_code": "+20", 280 | "code": "EG" 281 | }, 282 | { 283 | "name": "El Salvador", 284 | "dial_code": "+503", 285 | "code": "SV" 286 | }, 287 | { 288 | "name": "Equatorial Guinea", 289 | "dial_code": "+240", 290 | "code": "GQ" 291 | }, 292 | { 293 | "name": "Eritrea", 294 | "dial_code": "+291", 295 | "code": "ER" 296 | }, 297 | { 298 | "name": "Estonia", 299 | "dial_code": "+372", 300 | "code": "EE" 301 | }, 302 | { 303 | "name": "Ethiopia", 304 | "dial_code": "+251", 305 | "code": "ET" 306 | }, 307 | { 308 | "name": "Faroe Islands", 309 | "dial_code": "+298", 310 | "code": "FO" 311 | }, 312 | { 313 | "name": "Fiji", 314 | "dial_code": "+679", 315 | "code": "FJ" 316 | }, 317 | { 318 | "name": "Finland", 319 | "dial_code": "+358", 320 | "code": "FI" 321 | }, 322 | { 323 | "name": "France", 324 | "dial_code": "+33", 325 | "code": "FR" 326 | }, 327 | { 328 | "name": "French Guiana", 329 | "dial_code": "+594", 330 | "code": "GF" 331 | }, 332 | { 333 | "name": "French Polynesia", 334 | "dial_code": "+689", 335 | "code": "PF" 336 | }, 337 | { 338 | "name": "Gabon", 339 | "dial_code": "+241", 340 | "code": "GA" 341 | }, 342 | { 343 | "name": "Gambia", 344 | "dial_code": "+220", 345 | "code": "GM" 346 | }, 347 | { 348 | "name": "Georgia", 349 | "dial_code": "+995", 350 | "code": "GE" 351 | }, 352 | { 353 | "name": "Germany", 354 | "dial_code": "+49", 355 | "code": "DE" 356 | }, 357 | { 358 | "name": "Ghana", 359 | "dial_code": "+233", 360 | "code": "GH" 361 | }, 362 | { 363 | "name": "Gibraltar", 364 | "dial_code": "+350", 365 | "code": "GI" 366 | }, 367 | { 368 | "name": "Greece", 369 | "dial_code": "+30", 370 | "code": "GR" 371 | }, 372 | { 373 | "name": "Greenland", 374 | "dial_code": "+299", 375 | "code": "GL" 376 | }, 377 | { 378 | "name": "Grenada", 379 | "dial_code": "+1 473", 380 | "code": "GD" 381 | }, 382 | { 383 | "name": "Guadeloupe", 384 | "dial_code": "+590", 385 | "code": "GP" 386 | }, 387 | { 388 | "name": "Guam", 389 | "dial_code": "+1 671", 390 | "code": "GU" 391 | }, 392 | { 393 | "name": "Guatemala", 394 | "dial_code": "+502", 395 | "code": "GT" 396 | }, 397 | { 398 | "name": "Guinea", 399 | "dial_code": "+224", 400 | "code": "GN" 401 | }, 402 | { 403 | "name": "Guinea-Bissau", 404 | "dial_code": "+245", 405 | "code": "GW" 406 | }, 407 | { 408 | "name": "Guyana", 409 | "dial_code": "+595", 410 | "code": "GY" 411 | }, 412 | { 413 | "name": "Haiti", 414 | "dial_code": "+509", 415 | "code": "HT" 416 | }, 417 | { 418 | "name": "Honduras", 419 | "dial_code": "+504", 420 | "code": "HN" 421 | }, 422 | { 423 | "name": "Hungary", 424 | "dial_code": "+36", 425 | "code": "HU" 426 | }, 427 | { 428 | "name": "Iceland", 429 | "dial_code": "+354", 430 | "code": "IS" 431 | }, 432 | { 433 | "name": "India", 434 | "dial_code": "+91", 435 | "code": "IN" 436 | }, 437 | { 438 | "name": "Indonesia", 439 | "dial_code": "+62", 440 | "code": "ID" 441 | }, 442 | { 443 | "name": "Iraq", 444 | "dial_code": "+964", 445 | "code": "IQ" 446 | }, 447 | { 448 | "name": "Ireland", 449 | "dial_code": "+353", 450 | "code": "IE" 451 | }, 452 | { 453 | "name": "Israel", 454 | "dial_code": "+972", 455 | "code": "IL" 456 | }, 457 | { 458 | "name": "Italy", 459 | "dial_code": "+39", 460 | "code": "IT" 461 | }, 462 | { 463 | "name": "Jamaica", 464 | "dial_code": "+1 876", 465 | "code": "JM" 466 | }, 467 | { 468 | "name": "Japan", 469 | "dial_code": "+81", 470 | "code": "JP" 471 | }, 472 | { 473 | "name": "Jordan", 474 | "dial_code": "+962", 475 | "code": "JO" 476 | }, 477 | { 478 | "name": "Kazakhstan", 479 | "dial_code": "+7 7", 480 | "code": "KZ" 481 | }, 482 | { 483 | "name": "Kenya", 484 | "dial_code": "+254", 485 | "code": "KE" 486 | }, 487 | { 488 | "name": "Kiribati", 489 | "dial_code": "+686", 490 | "code": "KI" 491 | }, 492 | { 493 | "name": "Kuwait", 494 | "dial_code": "+965", 495 | "code": "KW" 496 | }, 497 | { 498 | "name": "Kyrgyzstan", 499 | "dial_code": "+996", 500 | "code": "KG" 501 | }, 502 | { 503 | "name": "Latvia", 504 | "dial_code": "+371", 505 | "code": "LV" 506 | }, 507 | { 508 | "name": "Lebanon", 509 | "dial_code": "+961", 510 | "code": "LB" 511 | }, 512 | { 513 | "name": "Lesotho", 514 | "dial_code": "+266", 515 | "code": "LS" 516 | }, 517 | { 518 | "name": "Liberia", 519 | "dial_code": "+231", 520 | "code": "LR" 521 | }, 522 | { 523 | "name": "Liechtenstein", 524 | "dial_code": "+423", 525 | "code": "LI" 526 | }, 527 | { 528 | "name": "Lithuania", 529 | "dial_code": "+370", 530 | "code": "LT" 531 | }, 532 | { 533 | "name": "Luxembourg", 534 | "dial_code": "+352", 535 | "code": "LU" 536 | }, 537 | { 538 | "name": "Madagascar", 539 | "dial_code": "+261", 540 | "code": "MG" 541 | }, 542 | { 543 | "name": "Malawi", 544 | "dial_code": "+265", 545 | "code": "MW" 546 | }, 547 | { 548 | "name": "Malaysia", 549 | "dial_code": "+60", 550 | "code": "MY" 551 | }, 552 | { 553 | "name": "Maldives", 554 | "dial_code": "+960", 555 | "code": "MV" 556 | }, 557 | { 558 | "name": "Mali", 559 | "dial_code": "+223", 560 | "code": "ML" 561 | }, 562 | { 563 | "name": "Malta", 564 | "dial_code": "+356", 565 | "code": "MT" 566 | }, 567 | { 568 | "name": "Marshall Islands", 569 | "dial_code": "+692", 570 | "code": "MH" 571 | }, 572 | { 573 | "name": "Martinique", 574 | "dial_code": "+596", 575 | "code": "MQ" 576 | }, 577 | { 578 | "name": "Mauritania", 579 | "dial_code": "+222", 580 | "code": "MR" 581 | }, 582 | { 583 | "name": "Mauritius", 584 | "dial_code": "+230", 585 | "code": "MU" 586 | }, 587 | { 588 | "name": "Mayotte", 589 | "dial_code": "+262", 590 | "code": "YT" 591 | }, 592 | { 593 | "name": "Mexico", 594 | "dial_code": "+52", 595 | "code": "MX" 596 | }, 597 | { 598 | "name": "Monaco", 599 | "dial_code": "+377", 600 | "code": "MC" 601 | }, 602 | { 603 | "name": "Mongolia", 604 | "dial_code": "+976", 605 | "code": "MN" 606 | }, 607 | { 608 | "name": "Montenegro", 609 | "dial_code": "+382", 610 | "code": "ME" 611 | }, 612 | { 613 | "name": "Montserrat", 614 | "dial_code": "+1664", 615 | "code": "MS" 616 | }, 617 | { 618 | "name": "Morocco", 619 | "dial_code": "+212", 620 | "code": "MA" 621 | }, 622 | { 623 | "name": "Myanmar", 624 | "dial_code": "+95", 625 | "code": "MM" 626 | }, 627 | { 628 | "name": "Namibia", 629 | "dial_code": "+264", 630 | "code": "NA" 631 | }, 632 | { 633 | "name": "Nauru", 634 | "dial_code": "+674", 635 | "code": "NR" 636 | }, 637 | { 638 | "name": "Nepal", 639 | "dial_code": "+977", 640 | "code": "NP" 641 | }, 642 | { 643 | "name": "Netherlands", 644 | "dial_code": "+31", 645 | "code": "NL" 646 | }, 647 | { 648 | "name": "Netherlands Antilles", 649 | "dial_code": "+599", 650 | "code": "AN" 651 | }, 652 | { 653 | "name": "New Caledonia", 654 | "dial_code": "+687", 655 | "code": "NC" 656 | }, 657 | { 658 | "name": "New Zealand", 659 | "dial_code": "+64", 660 | "code": "NZ" 661 | }, 662 | { 663 | "name": "Nicaragua", 664 | "dial_code": "+505", 665 | "code": "NI" 666 | }, 667 | { 668 | "name": "Niger", 669 | "dial_code": "+227", 670 | "code": "NE" 671 | }, 672 | { 673 | "name": "Nigeria", 674 | "dial_code": "+234", 675 | "code": "NG" 676 | }, 677 | { 678 | "name": "Niue", 679 | "dial_code": "+683", 680 | "code": "NU" 681 | }, 682 | { 683 | "name": "Norfolk Island", 684 | "dial_code": "+672", 685 | "code": "NF" 686 | }, 687 | { 688 | "name": "Northern Mariana Islands", 689 | "dial_code": "+1 670", 690 | "code": "MP" 691 | }, 692 | { 693 | "name": "Norway", 694 | "dial_code": "+47", 695 | "code": "NO" 696 | }, 697 | { 698 | "name": "Oman", 699 | "dial_code": "+968", 700 | "code": "OM" 701 | }, 702 | { 703 | "name": "Pakistan", 704 | "dial_code": "+92", 705 | "code": "PK" 706 | }, 707 | { 708 | "name": "Palau", 709 | "dial_code": "+680", 710 | "code": "PW" 711 | }, 712 | { 713 | "name": "Panama", 714 | "dial_code": "+507", 715 | "code": "PA" 716 | }, 717 | { 718 | "name": "Papua New Guinea", 719 | "dial_code": "+675", 720 | "code": "PG" 721 | }, 722 | { 723 | "name": "Paraguay", 724 | "dial_code": "+595", 725 | "code": "PY" 726 | }, 727 | { 728 | "name": "Peru", 729 | "dial_code": "+51", 730 | "code": "PE" 731 | }, 732 | { 733 | "name": "Philippines", 734 | "dial_code": "+63", 735 | "code": "PH" 736 | }, 737 | { 738 | "name": "Poland", 739 | "dial_code": "+48", 740 | "code": "PL" 741 | }, 742 | { 743 | "name": "Portugal", 744 | "dial_code": "+351", 745 | "code": "PT" 746 | }, 747 | { 748 | "name": "Puerto Rico", 749 | "dial_code": "+1 939", 750 | "code": "PR" 751 | }, 752 | { 753 | "name": "Qatar", 754 | "dial_code": "+974", 755 | "code": "QA" 756 | }, 757 | { 758 | "name": "Romania", 759 | "dial_code": "+40", 760 | "code": "RO" 761 | }, 762 | { 763 | "name": "Rwanda", 764 | "dial_code": "+250", 765 | "code": "RW" 766 | }, 767 | { 768 | "name": "Samoa", 769 | "dial_code": "+685", 770 | "code": "WS" 771 | }, 772 | { 773 | "name": "San Marino", 774 | "dial_code": "+378", 775 | "code": "SM" 776 | }, 777 | { 778 | "name": "Saudi Arabia", 779 | "dial_code": "+966", 780 | "code": "SA" 781 | }, 782 | { 783 | "name": "Senegal", 784 | "dial_code": "+221", 785 | "code": "SN" 786 | }, 787 | { 788 | "name": "Serbia", 789 | "dial_code": "+381", 790 | "code": "RS" 791 | }, 792 | { 793 | "name": "Seychelles", 794 | "dial_code": "+248", 795 | "code": "SC" 796 | }, 797 | { 798 | "name": "Sierra Leone", 799 | "dial_code": "+232", 800 | "code": "SL" 801 | }, 802 | { 803 | "name": "Singapore", 804 | "dial_code": "+65", 805 | "code": "SG" 806 | }, 807 | { 808 | "name": "Slovakia", 809 | "dial_code": "+421", 810 | "code": "SK" 811 | }, 812 | { 813 | "name": "Slovenia", 814 | "dial_code": "+386", 815 | "code": "SI" 816 | }, 817 | { 818 | "name": "Solomon Islands", 819 | "dial_code": "+677", 820 | "code": "SB" 821 | }, 822 | { 823 | "name": "South Africa", 824 | "dial_code": "+27", 825 | "code": "ZA" 826 | }, 827 | { 828 | "name": "South Georgia and the South Sandwich Islands", 829 | "dial_code": "+500", 830 | "code": "GS" 831 | }, 832 | { 833 | "name": "Spain", 834 | "dial_code": "+34", 835 | "code": "ES" 836 | }, 837 | { 838 | "name": "Sri Lanka", 839 | "dial_code": "+94", 840 | "code": "LK" 841 | }, 842 | { 843 | "name": "Sudan", 844 | "dial_code": "+249", 845 | "code": "SD" 846 | }, 847 | { 848 | "name": "Suriname", 849 | "dial_code": "+597", 850 | "code": "SR" 851 | }, 852 | { 853 | "name": "Swaziland", 854 | "dial_code": "+268", 855 | "code": "SZ" 856 | }, 857 | { 858 | "name": "Sweden", 859 | "dial_code": "+46", 860 | "code": "SE" 861 | }, 862 | { 863 | "name": "Switzerland", 864 | "dial_code": "+41", 865 | "code": "CH" 866 | }, 867 | { 868 | "name": "Tajikistan", 869 | "dial_code": "+992", 870 | "code": "TJ" 871 | }, 872 | { 873 | "name": "Thailand", 874 | "dial_code": "+66", 875 | "code": "TH" 876 | }, 877 | { 878 | "name": "Togo", 879 | "dial_code": "+228", 880 | "code": "TG" 881 | }, 882 | { 883 | "name": "Tokelau", 884 | "dial_code": "+690", 885 | "code": "TK" 886 | }, 887 | { 888 | "name": "Tonga", 889 | "dial_code": "+676", 890 | "code": "TO" 891 | }, 892 | { 893 | "name": "Trinidad and Tobago", 894 | "dial_code": "+1 868", 895 | "code": "TT" 896 | }, 897 | { 898 | "name": "Tunisia", 899 | "dial_code": "+216", 900 | "code": "TN" 901 | }, 902 | { 903 | "name": "Turkey", 904 | "dial_code": "+90", 905 | "code": "TR" 906 | }, 907 | { 908 | "name": "Turkmenistan", 909 | "dial_code": "+993", 910 | "code": "TM" 911 | }, 912 | { 913 | "name": "Turks and Caicos Islands", 914 | "dial_code": "+1 649", 915 | "code": "TC" 916 | }, 917 | { 918 | "name": "Tuvalu", 919 | "dial_code": "+688", 920 | "code": "TV" 921 | }, 922 | { 923 | "name": "Uganda", 924 | "dial_code": "+256", 925 | "code": "UG" 926 | }, 927 | { 928 | "name": "Ukraine", 929 | "dial_code": "+380", 930 | "code": "UA" 931 | }, 932 | { 933 | "name": "United Arab Emirates", 934 | "dial_code": "+971", 935 | "code": "AE" 936 | }, 937 | { 938 | "name": "United Kingdom", 939 | "dial_code": "+44", 940 | "code": "GB" 941 | }, 942 | { 943 | "name": "United States", 944 | "dial_code": "+1", 945 | "code": "US" 946 | }, 947 | { 948 | "name": "Uruguay", 949 | "dial_code": "+598", 950 | "code": "UY" 951 | }, 952 | { 953 | "name": "Uzbekistan", 954 | "dial_code": "+998", 955 | "code": "UZ" 956 | }, 957 | { 958 | "name": "Vanuatu", 959 | "dial_code": "+678", 960 | "code": "VU" 961 | }, 962 | { 963 | "name": "Wallis and Futuna", 964 | "dial_code": "+681", 965 | "code": "WF" 966 | }, 967 | { 968 | "name": "Yemen", 969 | "dial_code": "+967", 970 | "code": "YE" 971 | }, 972 | { 973 | "name": "Zambia", 974 | "dial_code": "+260", 975 | "code": "ZM" 976 | }, 977 | { 978 | "name": "Zimbabwe", 979 | "dial_code": "+263", 980 | "code": "ZW" 981 | }, 982 | { 983 | "name": "Åland Islands", 984 | "dial_code": "+358", 985 | "code": "AX" 986 | }, 987 | { 988 | "name": "Bolivia, Plurinational State of", 989 | "dial_code": "+591", 990 | "code": "BO" 991 | }, 992 | { 993 | "name": "Brunei Darussalam", 994 | "dial_code": "+673", 995 | "code": "BN" 996 | }, 997 | { 998 | "name": "Cocos (Keeling) Islands", 999 | "dial_code": "+61", 1000 | "code": "CC" 1001 | }, 1002 | { 1003 | "name": "Congo, The Democratic Republic of the", 1004 | "dial_code": "+243", 1005 | "code": "CD" 1006 | }, 1007 | { 1008 | "name": "Cote d'Ivoire", 1009 | "dial_code": "+225", 1010 | "code": "CI" 1011 | }, 1012 | { 1013 | "name": "Falkland Islands (Malvinas)", 1014 | "dial_code": "+500", 1015 | "code": "FK" 1016 | }, 1017 | { 1018 | "name": "Guernsey", 1019 | "dial_code": "+44", 1020 | "code": "GG" 1021 | }, 1022 | { 1023 | "name": "Holy See (Vatican City State)", 1024 | "dial_code": "+379", 1025 | "code": "VA" 1026 | }, 1027 | { 1028 | "name": "Hong Kong", 1029 | "dial_code": "+852", 1030 | "code": "HK" 1031 | }, 1032 | { 1033 | "name": "Iran, Islamic Republic of", 1034 | "dial_code": "+98", 1035 | "code": "IR" 1036 | }, 1037 | { 1038 | "name": "Isle of Man", 1039 | "dial_code": "+44", 1040 | "code": "IM" 1041 | }, 1042 | { 1043 | "name": "Jersey", 1044 | "dial_code": "+44", 1045 | "code": "JE" 1046 | }, 1047 | { 1048 | "name": "Korea, Democratic People's Republic of", 1049 | "dial_code": "+850", 1050 | "code": "KP" 1051 | }, 1052 | { 1053 | "name": "Korea, Republic of", 1054 | "dial_code": "+82", 1055 | "code": "KR" 1056 | }, 1057 | { 1058 | "name": "Lao People's Democratic Republic", 1059 | "dial_code": "+856", 1060 | "code": "LA" 1061 | }, 1062 | { 1063 | "name": "Libyan Arab Jamahiriya", 1064 | "dial_code": "+218", 1065 | "code": "LY" 1066 | }, 1067 | { 1068 | "name": "Macao", 1069 | "dial_code": "+853", 1070 | "code": "MO" 1071 | }, 1072 | { 1073 | "name": "Macedonia, The Former Yugoslav Republic of", 1074 | "dial_code": "+389", 1075 | "code": "MK" 1076 | }, 1077 | { 1078 | "name": "Micronesia, Federated States of", 1079 | "dial_code": "+691", 1080 | "code": "FM" 1081 | }, 1082 | { 1083 | "name": "Moldova, Republic of", 1084 | "dial_code": "+373", 1085 | "code": "MD" 1086 | }, 1087 | { 1088 | "name": "Mozambique", 1089 | "dial_code": "+258", 1090 | "code": "MZ" 1091 | }, 1092 | { 1093 | "name": "Palestinian Territory, Occupied", 1094 | "dial_code": "+970", 1095 | "code": "PS" 1096 | }, 1097 | { 1098 | "name": "Pitcairn", 1099 | "dial_code": "+872", 1100 | "code": "PN" 1101 | }, 1102 | { 1103 | "name": "Réunion", 1104 | "dial_code": "+262", 1105 | "code": "RE" 1106 | }, 1107 | { 1108 | "name": "Russia", 1109 | "dial_code": "+7", 1110 | "code": "RU" 1111 | }, 1112 | { 1113 | "name": "Saint Barthélemy", 1114 | "dial_code": "+590", 1115 | "code": "BL" 1116 | }, 1117 | { 1118 | "name": "Saint Helena, Ascension and Tristan Da Cunha", 1119 | "dial_code": "+290", 1120 | "code": "SH" 1121 | }, 1122 | { 1123 | "name": "Saint Kitts and Nevis", 1124 | "dial_code": "+1 869", 1125 | "code": "KN" 1126 | }, 1127 | { 1128 | "name": "Saint Lucia", 1129 | "dial_code": "+1 758", 1130 | "code": "LC" 1131 | }, 1132 | { 1133 | "name": "Saint Martin", 1134 | "dial_code": "+590", 1135 | "code": "MF" 1136 | }, 1137 | { 1138 | "name": "Saint Pierre and Miquelon", 1139 | "dial_code": "+508", 1140 | "code": "PM" 1141 | }, 1142 | { 1143 | "name": "Saint Vincent and the Grenadines", 1144 | "dial_code": "+1 784", 1145 | "code": "VC" 1146 | }, 1147 | { 1148 | "name": "Sao Tome and Principe", 1149 | "dial_code": "+239", 1150 | "code": "ST" 1151 | }, 1152 | { 1153 | "name": "Somalia", 1154 | "dial_code": "+252", 1155 | "code": "SO" 1156 | }, 1157 | { 1158 | "name": "Svalbard and Jan Mayen", 1159 | "dial_code": "+47", 1160 | "code": "SJ" 1161 | }, 1162 | { 1163 | "name": "Syrian Arab Republic", 1164 | "dial_code": "+963", 1165 | "code": "SY" 1166 | }, 1167 | { 1168 | "name": "Taiwan, Province of China", 1169 | "dial_code": "+886", 1170 | "code": "TW" 1171 | }, 1172 | { 1173 | "name": "Tanzania, United Republic of", 1174 | "dial_code": "+255", 1175 | "code": "TZ" 1176 | }, 1177 | { 1178 | "name": "Timor-Leste", 1179 | "dial_code": "+670", 1180 | "code": "TL" 1181 | }, 1182 | { 1183 | "name": "Venezuela, Bolivarian Republic of", 1184 | "dial_code": "+58", 1185 | "code": "VE" 1186 | }, 1187 | { 1188 | "name": "Viet Nam", 1189 | "dial_code": "+84", 1190 | "code": "VN" 1191 | }, 1192 | { 1193 | "name": "Virgin Islands, British", 1194 | "dial_code": "+1 284", 1195 | "code": "VG" 1196 | }, 1197 | { 1198 | "name": "Virgin Islands, U.S.", 1199 | "dial_code": "+1 340", 1200 | "code": "VI" 1201 | } 1202 | ] --------------------------------------------------------------------------------