Skip to content

Easy way to get the prefix of phone numbers in a country and the name of the country (English).

License

Notifications You must be signed in to change notification settings

mobdim/BDVCountryNameAndCode

 
 

Repository files navigation

BDVCountryNameAndCode

Easy way to get the prefix of phone numbers in a country and the name of the country (English). It took me quite a while to find some useful arrays on this world wide web, and figured it might be a useful implementation for some.

How to use

Add BDVCountryNameAndCode.h and BDVCountryNameAndCode.m to your project.

Get prefix of current locale of user:

BDVCountryNameAndCode *BDVCountryNameAndCode [[BDVCountryNameAndCode alloc] init];
NSString *prefixOfCurrentLocale = [BDVCountryNameAndCode prefixForCurrentLocale]; // Returns "+1" for Canada

Get the name of the current country in the same way:

BDVCountryNameAndCode *BDVCountryNameAndCode [[BDVCountryNameAndCode alloc] init];
NSString *nameOfCurrentLocale = [BDVCountryNameAndCode countryNameForCurrentLocale]; // Returns "Canada"

Get the image flat of current locale of user:

BDVCountryNameAndCode *BDVCountryNameAndCode [[BDVCountryNameAndCode alloc] init];
UIImage *flag = [BDVCountryNameAndCode countryLocaleImage]; // Returns UIImage*

Easy but convenient

TODO

Create a CocoaPods

About

Easy way to get the prefix of phone numbers in a country and the name of the country (English).

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Objective-C 100.0%