Created
March 25, 2015 03:26
-
-
Save l4u/542ee6439ff2cbeed6ad to your computer and use it in GitHub Desktop.
Parse a number with NBPhoneNumberUtil in Swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let phoneUtil = NBPhoneNumberUtil() | |
let phoneNumber = phoneUtil.parse(number.string, defaultRegion:"US", error:nil) | |
let phoneNumberInString = phoneUtil.format(nbPhoneNumber, numberFormat: NBEPhoneNumberFormatINTERNATIONAL, error: nil) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment