PhoneNumberKitSwiftUI

A SwiftUI phone-number field with live formatting, validation, and a searchable country picker.

Format and validate as you type

Use optional international prefixes, example placeholders, and a country picker with flag support. One observable PhoneNumberStore exposes the formatted text, national digits, region, validation state, and parsed PhoneNumberKit value.

Install with Swift Package Manager

Add this package dependency, then add the PhoneNumberKitSwiftUI library to your app target.

.package(
    url: "https://github.com/SwiftDevStudent/PhoneNumberKitSwiftUI.git",
    from: "1.0.2"
)

The usage guide shows how to create a PhoneNumberStore and pass it to PhoneNumberField. A demo view includes option toggles and the current field values.

Requirements and license

Platform
iOS 17 or later
Language
Swift 6.2 or later
Dependency
PhoneNumberKit 5.0.2 or later
License
MIT

This companion package is backed by PhoneNumberKit. The upstream library and this SwiftUI package have separate repositories.