Latest 0.5.0
Homepage https://github.com/getlua/LTPhoneNumberField
License MIT
Platforms ios 6.0, requires ARC
Dependencies libPhoneNumber-iOS
Authors

LTPhoneNumberField is a subclass of UITextField that dynamically formats a phone number as it is typed. It relies on an obj-c port of Google’s libphonenumber library to handle phone number parsing.

Usage

To run the example project; clone the repo, and run pod install from the Example directory first.

  • Use initWithFrame:regionCode: to initialize. Uses current locale if no region code is specified
  • Readonly BOOL property containsValidNumber fires KVO notifications if its value changes
  • Instance method phoneNumberWithFormat: returns the current phone number in the specified format
  • setText: asynchronously filters out all non-numeric characters and formats the phone number before assigning it to the text field

Requirements

  • Tested on iOS 6.1 and above, including iOS 7

Installation

LTPhoneNumberField is available through CocoaPods, to install
it simply add the following line to your Podfile:

pod "LTPhoneNumberField"

Author

Colin Regan, [email protected]

License

LTPhoneNumberField is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "LTPhoneNumberField",
    "version": "0.5.0",
    "summary": "A UITextField subclass that formats a phone number as you type.",
    "description": "                       LTPhoneNumberField is a subclass of UITextField that dynamically formats a phone number as it is typed by the user.nn                       * Locale-agnosticn                       * Delegates phone number parsing to libPhoneNumbern",
    "homepage": "https://github.com/getlua/LTPhoneNumberField",
    "license": "MIT",
    "authors": {
        "Colin Regan": "[email protected]"
    },
    "source": {
        "git": "https://github.com/getlua/LTPhoneNumberField.git",
        "tag": "0.5.0"
    },
    "social_media_url": "https://twitter.com/khaullen",
    "platforms": {
        "ios": "6.0"
    },
    "requires_arc": true,
    "source_files": "Classes/**/*.{h,m}",
    "ios": {
        "exclude_files": "Classes/osx"
    },
    "osx": {
        "exclude_files": "Classes/ios"
    },
    "dependencies": {
        "libPhoneNumber-iOS": [
            "~> 0.7.2"
        ]
    }
}

Pin It on Pinterest

Share This