| 测试已测试 | ✗ |
| 语言语言 | SwiftSwift |
| 许可证 | MIT |
| 发布最后发布 | 2017年12月 |
| SwiftSwift 版本 | 4.0 |
| SPM支持 SPM | ✗ |
维护者:Afees Lawal.
| 依赖关系 | |
| PhoneNumberKit | ~> 2.0 |
| libPhoneNumber-iOS | ~> 0.8 |
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 目录中运行 pod install。
CountryPhoneNumberValidator 通过 CocoaPods 提供。要安装它,只需将以下行添加到 Podfile 中
pod 'CountryPhoneNumberValidator'moderateepheezy, [email protected]
CountryPhoneNumberValidator 在 MIT 许可证下提供。有关更多信息,请参阅 LICENSE 文件。