CountryPhoneNumberValidator

CI Status Version License Platform

Screenshot

Alt text

Usage

import CountryPhoneNumberValidator

var phoneView: PhoneNumberView!

phoneView = PhoneNumberView(vc: self, button: verifyButton)

verifyButton.addTarget(self, action: #selector(verifyPhoneNumber), for: .touchUpInside)

func verifyPhoneNumber() {
        phoneView.validate { (completed) in
            if completed {
                self.showAlert(withTitle: "Success", message: "PhoneNumber is Valid")
            }else{
                self.showAlert(withTitle: "", message: "The phone number is not valid.")
            }
        }
    }

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

Copy CountryPhoneNumberValidator to your project folder

Todo

  1. Refactor PhoneNumberView for customization.
  2. Improve phone number validation.
  3. Make installing from cocoapod.

Author

moderateepheezy, moderateepheezy@gmail.com

License

CountryPhoneNumberValidator is available under the MIT license. See the LICENSE file for more info.