Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mobile number validation #180

Open
nigamsiddhant opened this issue Mar 28, 2021 · 0 comments
Open

Mobile number validation #180

nigamsiddhant opened this issue Mar 28, 2021 · 0 comments

Comments

@nigamsiddhant
Copy link

nigamsiddhant commented Mar 28, 2021

Philippines and some other country mobile number is giving false result even the number is correct.

Have changed in fpntextfield.swift

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

private func updatePlaceholder() {
      if let countryCode = selectedCountry?.code {
          do {
              let example = try phoneUtil.getExampleNumber(forType: countryCode.rawValue, type: NBEPhoneNumberType.MOBILE)
              let phoneNumber = "+\(example.countryCode.stringValue)\(example.nationalNumber.stringValue)"

              if let inputString = formatter?.inputString(phoneNumber) {
                  placeholder = remove(dialCode: "+\(example.countryCode.stringValue)", in: inputString)
              } else {
                  placeholder = nil
              }
          } catch _ {
              placeholder = nil
          }
      } else {
          placeholder = nil
      }
  }

Simulator Screen Shot - iPhone SE (2nd generation) - 2021-03-28 at 17 19 31

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant