Update README.md
You can use the Swift Package Manager to install DEPhoneNumberFormatter by adding the following dependency to your Package.swift file:
DEPhoneNumberFormatter
Package.swift
.package(url: "https://github.com/Darkngs/DEPhoneNumberFormatter.git", from: "2.0.0"),
Alternatively you can directly add the DEPhoneNumberFormatter.swift & DEPhoneNumberTextField.swift source files to your project.
// NANP countries let phoneNumberFormatter = DEPhoneNumberFormatter() print(phoneNumberFormatter.number(from: "1")) print(phoneNumberFormatter.number(from: "12")) print(phoneNumberFormatter.number(from: "123")) print(phoneNumberFormatter.number(from: "1234")) print(phoneNumberFormatter.number(from: "12345")) print(phoneNumberFormatter.number(from: "123456")) print(phoneNumberFormatter.number(from: "1234567")) print(phoneNumberFormatter.number(from: "12345678")) print(phoneNumberFormatter.number(from: "123456789")) print(phoneNumberFormatter.number(from: "1234567890"))
(1 (12 (123 (123) 4 (123) 45 (123) 456 (123) 456-7 (123) 456-78 (123) 456-789 (123) 456-7890
let textField = DEPhoneNumberTextField() textField.setup()
©Copyright 2023 CCF 开源发展委员会 Powered by Trustie& IntelliDE 京ICP备13000930号
DEPhoneNumberFormatter
Integration
Swift Package Manager
You can use the Swift Package Manager to install
DEPhoneNumberFormatter
by adding the following dependency to yourPackage.swift
file:Manually
Alternatively you can directly add the DEPhoneNumberFormatter.swift & DEPhoneNumberTextField.swift source files to your project.
Example - DEPhoneNumberFormatter
Output
Example - DEPhoneNumberTextField