title: iOS Convert phone number to international format
body: <p>In my iOS app I have to convert a phone number (taken in the contacts) and convert it in international format (to send SMS automatically with an extern library). I saw <a href="https://github.com/iziz/libPhoneNumber-iOS" rel="nofollow">libPhoneNumber</a> but the problem is that we have to enter the country code, and the app have to work in all (almost) countries, so I don't know what is the user's country.</p>
  
  <p>Here is how the library works : </p>
  
  <pre><code>let phoneUtil = NBPhoneNumberUtil()
  let phoneNumberConverted = try phoneUtil.parse("0665268242", defaultRegion: "FR") // So I don't know the country of the user here
  print(try? phoneUtil.format(phoneNumberConverted, numberFormat: NBEPhoneNumberFormat.INTERNATIONAL))
  </code></pre>