PhoneNumberKit is a Swift framework for parsing, formatting and validating international phone numbers.
The framework solves the problem of handling international phone number data reliably by wrapping the metadata and logic from Google's libphonenumber project in a Swift-native interface. It parses phone number strings into structured components, validates them against regional rules, normalizes them to standard formats, and provides an AsYouType formatter for text input fields. The tool extracts country codes, region information, and number type classification from any phone number string.
Developers building iOS applications that need to accept, store or display phone numbers should choose this framework. It suits any project requiring accurate international phone number handling without implementing custom validation logic. The framework is optimized for iOS and automatically detects the device's default region code. Performance is efficient, handling large batches of parses quickly.
This repository is frozen and no longer maintained. Active development has moved to the PhoneNumberKit organization, where the core parsing, formatting and validation functionality continues at version 5.0.0 and above, while UI components including a phone number text field and country code picker are now in a separate PhoneNumberKitUI package. Users of this frozen repository should migrate to the organization's maintained version, which uses the same module name so core code requires no changes. The validation metadata in this repository will become outdated over time as phone numbering plans change globally.