• Stars
    star
    147
  • Rank 251,347 (Top 5 %)
  • Language
    Objective-C
  • License
    MIT License
  • Created almost 13 years ago
  • Updated over 10 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

NSFormatter subclass for formatting phone numbers.

ECPhoneNumberFormatter

NSFormatter subclass for formatting phone numbers.

Usage

Format a number

ECPhoneNumberFormatter *formatter = [[ECPhoneNumberFormatter alloc] init];
NSString *formattedNumber = [formatter stringForObjectValue:@"2345677890"]
// formattedNumber = @"(234) 567-7890"

Remove formatting

ECPhoneNumberFormatter *formatter = [[ECPhoneNumberFormatter alloc] init];
id objectValue;
NSString *error;
[formatter getObjectValue:&objectValue forString:@"1 (234) 567-8900" errorDescription:&error];
// objectValue = @"12345678900"

Format a NSTextField

ECPhoneNumberFormatter *formatter = [[ECPhoneNumberFormatter alloc] init];
textField.cell.formatter = formatter;

// textField.objectValue will be unformatted
// textField.stringValue will be formatted

MIT License

Copyright (c) 2013 Michael Enriquez (http://enriquez.me)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

More Repositories

1

coinpocketapp.com

Bitcoin wallet that stores Bitcoin in your browser.
JavaScript
84
star
2

uiauto

UI Automation script runner.
Ruby
54
star
3

ezpz-tooltip

jquery tooltip plugin
JavaScript
27
star
4

MEDeclarativeTable

Describe the structure of your `UITableView`'s sections and rows in an object oriented way.
Objective-C
26
star
5

ezpz-hint

A simple jQuery plugin for showing a text field's label inside the textbox itself. The hint disappears when it is given focus, and appears again if the inputted text is empty. Typically used for search and login forms.
JavaScript
22
star
6

MEActionSheet

UIActionSheet subclass with a simpler API using blocks and target/action invocations.
Objective-C
12
star
7

enriquez.github.com

CSS
12
star
8

MEAlertView

UIAlertView subclass with a simpler API using blocks and target/action invocations.
Objective-C
11
star
9

swifterate

Swift code generator. Generate strongly typed enums based on your Info.plist and Asset Catalog. No more magic strings!
Ruby
10
star
10

april_oneil

April O'Neil is a reporter for Facebook's xctool
Ruby
6
star
11

chocolate-meat

Mephisto Theme. Simple two column layout built with Blueprint CSS
4
star
12

ActiveBraintree

ActiveRecord-like classes for working with Braintree
Ruby
2
star
13

for-sale

Web app for posting things you want to sell. Built on Rails
JavaScript
2
star
14

crb_members

Community site for the Columbus Ruby Brigade members
Ruby
2
star
15

craps

Text-based Craps game
Ruby
2
star
16

mikes-generators

My style Rails generators
Ruby
1
star
17

span-error-messages

Rails plugin to use span tags instead of divs for errors
Ruby
1
star
18

whereami

Command line utility that reports your machine's latitude and longitude.
Ruby
1
star
19

greed

A console app for the dice game Greed
Ruby
1
star
20

PeepOpen-Xcode-4-Plugin

Objective-C
1
star