Skip to content
CAI
Software that uses CAICheck a score

marmelroy/PhoneNumberKit

60.0

Adequate · 30 September 2026

4.2k

lines of production code

Swift

primary language

2

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This system is a Swift library for parsing, formatting, and validating international phone numbers, with core logic now maintained in the PhoneNumberKit package. It provides UI components, including a customizable country code picker and text field, to facilitate phone number input in iOS applications. The system supports multiple Apple platforms and includes comprehensive test coverage to ensure accuracy and performance.

How it got here

2015 — Migration to PhoneNumberKit and platform expansion

11 changes.

Development shifted to the new PhoneNumberKit organization, introducing version 5.0.0 with separated UI components and expanded support for macOS, tvOS, and watchOS. The period focused on stabilizing the codebase through comprehensive testing, Swift 5.6 Linux crash fixes, and updating internal metadata to align with Google's libphonenumber standards.

2019–2025 — UI customization and tooling improvements

4 changes.

This period focused on enhancing the flexibility of the country code picker by introducing comprehensive styling options and support for custom UI components. The team also improved developer experience by adding Swift Package Manager workspace configuration and established performance baselines to prevent regressions in phone number parsing.

Features

Add iOS PhoneBook sample app

The PhoneBook example project now includes a complete iOS application that demonstrates phone number parsing and formatting. The app features a user interface with labels to display the parsed number, country code, and country name, along with a button to select a contact from the device's address book. It utilizes the PhoneNumberKit library to process the selected contact's phone number and update the UI accordingly.

examples/PhoneBook/Sample · high confidence

Added Xcode schemes for macOS, tvOS, and watchOS targets

The project now includes dedicated Xcode schemes for macOS, tvOS, and watchOS platforms, enabling developers to build, test, and run the PhoneNumberKit framework on these additional Apple platforms alongside the existing iOS target.

PhoneNumberKit.xcodeproj/xcshareddata/xcschemes · high confidence

Added Xcode workspace configuration for Swift Package Manager

A new Xcode workspace file (contents.xcworkspacedata) has been added to the .swiftpm directory. This file configures the workspace to reference the local package, enabling developers to open and edit the Swift package directly within Xcode.

.swiftpm · high confidence

AsYouType sample app now supports configurable phone field options

The AsYouType example project has been updated to include a user interface for toggling key PhoneNumberKit features. Users can now enable or disable the inclusion of the country prefix, display of the flag icon, example placeholder text, and the default country code picker UI directly within the sample app via switches.

examples/AsYouType/Sample · high confidence

Country code picker UI becomes fully customizable

Developers can now control the appearance of the country code picker through a new \CountryCodePickerOptions\ configuration struct. This allows customization of the picker's background, separator, and tint colors, as well as detailed styling for table cells (text color, font, background, selection state) and section headers. The UI components also support replacing the default table cells and headers with custom nibs or classes via the \ReusableCellType\ option.

PhoneNumberKit/UI · high confidence

New example app for customizing country picker cells

The CustomCountryPickerCells example now includes a complete iOS sample project that demonstrates how to replace the default country picker list cells and section headers with custom implementations. By providing CustomCell and CustomHeaderView classes alongside their corresponding XIB files, the example shows how to configure CountryCodePickerOptions to use custom nibs, allowing developers to apply specific styling and layout to the picker's UI elements.

examples/CustomCountryPickerCells · high confidence

Behavioural changes

Added Xcode workspace configuration files

The project now includes a standard Xcode workspace file (contents.xcworkspacedata) that references the main project, along with an IDEWorkspaceChecks.plist file. This configuration ensures that Xcode correctly recognizes the workspace structure and suppresses the 32-bit warning, providing a more stable development environment for users opening the project.

PhoneNumberKit.xcodeproj/project.xcworkspace · high confidence

PhoneBook example project migrated to Swift Package Manager

The PhoneBook sample application's Xcode project has been updated to use Swift Package Manager (SPM) for dependency management. The project file now explicitly references the local PhoneNumberKit package via the SPM integration, replacing previous dependency resolution methods. This change ensures the example app builds against the current package structure and utilizes modern Xcode build settings.

examples/PhoneBook/Sample.xcodeproj · high confidence

PhoneNumberKit project configuration update

The Xcode project file has been updated to include new source files and build configurations, specifically adding support for \PhoneNumberFormatter.swift\, \MetadataParsing.swift\, and \Bundle+Resources.swift\. The project now references \PhoneNumberUtility.swift\ (renamed from \PhoneNumberKit\) and includes UI components like \CountryCodePickerViewController\ and \PhoneNumberTextField\. Additionally, the build settings have been modernized to target iOS 9, restrict architectures to arm64/x86\_64, and update Swift version settings, while also adding \CoreTelephony\ and \Foundation\ frameworks to the build phases.

PhoneNumberKit.xcodeproj · medium confidence

Repository deprecation and migration to PhoneNumberKit organization

This repository is deprecated and frozen at version 4.3.0; active development has moved to the PhoneNumberKit organization. The core parsing, formatting, and validation logic is now in the PhoneNumberKit/PhoneNumberKit package (version 5.0.0+), while the UI components (PhoneNumberTextField and the country-code picker) have been separated into the PhoneNumberKitUI package (version 1.0.0+). Users should update their package dependencies to point to the new repositories and, if they use the UI components, import PhoneNumberKitUI in addition to PhoneNumberKit.

(repo-wide) · high confidence

Updated phone number metadata to version 9.0.31

The PhoneNumberKit library's internal phone number metadata has been updated to version 9.0.31, synchronizing with the latest Google libphonenumber release. This update refreshes the formatting rules, validation patterns, and example numbers for supported countries and territories, ensuring that phone number parsing and formatting remain accurate against current international standards.

PhoneNumberKit/Resources · high confidence

Fixes

PhoneNumberKit 3.4.2: Swift 5.6 Linux crash fix and bundle resource handling

This update addresses a crash on Swift 5.6 when running on Linux and improves how the library locates its metadata resources. The \Bundle+Resources.swift\ file introduces a custom bundle locator to prevent crashes in SwiftUI previews when using Swift Package Manager, ensuring metadata loads correctly across different build contexts. Additionally, the \NSRegularExpression+Swift.swift\ extension now properly handles \@escaping\ blocks in the \enumerateMatches\ method, resolving the specific compilation and runtime issues encountered on Linux with Swift 5.6.

PhoneNumberKit · high confidence

Test coverage

Added comprehensive test suite for PhoneNumberKit; Added performance test baseline for PhoneNumberKit.

Dependencies

PhoneNumberKit 4.3.0 release with Swift 5.5 and platform updates

This release updates the PhoneNumberKit library to version 4.3.0, requiring Swift 5.5 and setting minimum deployment targets to iOS 12.0, macOS 10.13, tvOS 12.0, and watchOS 4.0. The package now supports both static and dynamic linking via distinct library targets in Swift Package Manager and includes a privacy manifest resource bundle for App Store compliance.

(dependencies) · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 60 → 60 (+0.4)
  • Rubric changed (rubric-2026.09.11 → rubric-2026.09.18) — scores are not directly comparable.

Lenses

  • Code Health 94 → 95 (+0.7)
  • Architecture 90 → 97 (+6.1)
  • Maturity 62 → 62 (+0.0)
  • Readiness 52 → 55 (+2.8)
  • Security 53 → 53 (+0.0)

Resolved (3)

  • Documentation: no installation or build instructions (README.md)
  • Documentation: no usage examples (README.md)
  • Off-boarding risk: anonymized user #1

New (7)

  • Coverage not measured — Swift suite
  • Dependency hygiene PARTLY measured — SwiftPM pinning read, dependency currency NOT established
  • Documentation: no architecture or design documentation (README.md)
  • Duplicated block (5 lines × 2) (PhoneNumberKit/NSRegularExpression+Swift.swift)
  • Inconsistent naming for region/country lookup operations. 'getRegionCode' takes a PhoneNumber object, while 'countryCode' takes a String (presumably a region code or phone string) and returns a UInt64. The verb 'get' is used for one but not the other, and the input types are ambiguous (String could be region code or phone number).
  • Inconsistent parameter naming and behavior between single and batch parsing methods. The single-item method uses 'ignoreType' but lacks a flag to control failure handling (e.g., returning nil vs throwing vs empty), whereas the batch method explicitly exposes 'shouldReturnFailedEmptyNumbers'. This forces users to guess the default failure behavior for the single-item API or use the batch API with a single-element array.
  • Off-boarding risk: anonymized user #1

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

marmelroy/PhoneNumberKit was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 30 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 169ab10234347fb19b37441f2867ace896a284b0 — the exact code this score is about.
  • Scored under rubric-2026.09.18 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-cb25ca4feafa.