Swift 5.3 framework for parsing, formatting and validating international phone numbers. Inspired by Google's libphonenumber. Import PhoneNumberKit at the top of the Swift file that will interact with a phone number. All of your interactions with PhoneNumberKit happen through a PhoneNumberKit object. The first step you should take is to allocate one. A PhoneNumberKit instance is relatively expensive to allocate (it parses the metadata and keeps it in memory for the object's lifecycle), you should try and make sure PhoneNumberKit is allocated once and deallocated when no longer needed. To parse a string, use the parse function. The region code is automatically computed but can be overridden if needed. PhoneNumberKit automatically does a hard type validation to ensure that the object created is valid, this can be quite costly performance-wise and can be turned off if needed.

Features

  • Validate, normalize and extract the elements of any phone number string
  • Simple Swift syntax and a lightweight readable codebase
  • Best-in-class metadata from Google's libPhoneNumber project
  • Fully tested to match the accuracy of Google's JavaScript implementation of libPhoneNumber
  • Built for iOS. Automatically grabs the default region code from the phone
  • Convert country codes to country names and vice versa

Project Samples

Project Activity

See All Activity >

Categories

Telephony, Frameworks

License

MIT License

Follow PhoneNumberKit

PhoneNumberKit Web Site

Other Useful Business Software
MongoDB Atlas runs apps anywhere Icon
MongoDB Atlas runs apps anywhere

Deploy in 115+ regions with the modern database for every enterprise.

MongoDB Atlas gives you the freedom to build and run modern applications anywhere—across AWS, Azure, and Google Cloud. With global availability in over 115 regions, Atlas lets you deploy close to your users, meet compliance needs, and scale with confidence across any geography.
Start Free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of PhoneNumberKit!

Additional Project Details

Operating Systems

Apple iPhone

Programming Language

Swift

Related Categories

Swift Telephony Software, Swift Frameworks

Registered

2021-12-14