chronotruck / FlagPhoneNumber

A formatted phone number UITextField with country flag picker.
Apache License 2.0
436 stars 316 forks source link

Mobile Phone Placeholder #109

Open Sydney-o9 opened 4 years ago

Sydney-o9 commented 4 years ago

At the moment the placeholder shows a landline phone number, is it possible to use a mobile phone number placeholder?

grifas commented 4 years ago

FlagPhoneNumber uses libPhoneNumber lib and what I know about it now, it's not possible to use a mobile phone number.

Sydney-o9 commented 4 years ago

Yes you can @grifas - see NBPhoneNumberUtil.

So it's possible to do the following in FPNTextField

let example = try phoneUtil.getExampleNumber(forType: countryCode.rawValue, type: NBEPhoneNumberType.MOBILE)

Edit. Maybe we could have a setExampleNumberType(_ type:NBEPhoneNumberType) method

phoneNumberTextField.setExampleNumberType(NBEPhoneNumberType.MOBILE)