Skip to content

HMDiallingCode gets the dialling code of the user's current location. It uses CoreLocation and reverse geocoding to determine the country of the user, then retrieve it's international dialling code. Additionally, it can be used to get the dialling code for a specific country or the counties that use a specific dialling code.

HeshamMegid/HMDiallingCode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

HMDiallingCode

HMDiallingCode gets the dialling code of the user's current location. It uses CoreLocation and reverse geocoding to determine the country of the user, then retrieve it's international dialling code. Additionally, it can be used to get the dialling code for a specific country or the counties that use a specific dialling code.

Usage

Included is a demo project showing how to use the classes.

To use in your own project, first import HMDiallingCode.m, HMDiallingCode.h and DiallingCodes.plist, then add CoreLocation to your linked libraries.

Then init your object with a delegate:

- (id)initWithDelegate:(id<HMDiallingCodeDelegate>)delegate;

Then call getDiallingCodeForCurrentLocation to start the retrieval.

You should implement the methods of HMDiallingCodeDelegate to get call backs after success/failure.

You could use getDiallingCodeForCountry to get the dialling code for a specific country and getCountriesWithDiallingCode to get an array of country codes that match a dialling code.

HMDiallingCode

License

Feel free to do whatever you want with this code.

If this code was helpful, I would love to hear from you.

@HeshamMegid
http://hesh.am

About

HMDiallingCode gets the dialling code of the user's current location. It uses CoreLocation and reverse geocoding to determine the country of the user, then retrieve it's international dialling code. Additionally, it can be used to get the dialling code for a specific country or the counties that use a specific dialling code.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published