# bdvcountrynameandcode **Repository Path**: mirrors/bdvcountrynameandcode ## Basic Information - **Project Name**: bdvcountrynameandcode - **Description**: Get mobile prefix (+1 etc) based on current locale of user - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2017-04-02 - **Last Updated**: 2025-09-06 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README 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: ```objective-c BDVCountryNameAndCode *BDVCountryNameAndCode = [[BDVCountryNameAndCode alloc] init]; NSString *prefixOfCurrentLocale = [BDVCountryNameAndCode prefixForCurrentLocale]; // Returns "+1" for Canada ``` Get the name of the current country in the same way: ```objective-c BDVCountryNameAndCode *BDVCountryNameAndCode = [[BDVCountryNameAndCode alloc] init]; NSString *nameOfCurrentLocale = [BDVCountryNameAndCode countryNameForCurrentLocale]; // Returns "Canada" ``` Get the image flag of current locale of user: ```objective-c BDVCountryNameAndCode *BDVCountryNameAndCode = [[BDVCountryNameAndCode alloc] init]; UIImage *flagOfCurrentLocale = [BDVCountryNameAndCode countryFlagForCurrentLocale]; // Returns UIImage ``` Easy but convenient TODO ===================== - Create podspec - Add new languages for ```[BDVCountryNameAndCode countryNameForCurrentLocale]```