Skip to content

Instantly share code, notes, and snippets.

@l4u
Created March 25, 2015 03:26
Show Gist options
  • Save l4u/542ee6439ff2cbeed6ad to your computer and use it in GitHub Desktop.
Save l4u/542ee6439ff2cbeed6ad to your computer and use it in GitHub Desktop.
Parse a number with NBPhoneNumberUtil in Swift
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