NKVPhonePicker
An UITextField subclass to simplify country code's picking in Swift 5.0
Preview
Installation
NKVPhonePicker is available through CocoaPods. To install
it, simply add the following line to your Podfile:
Also you can try an example project with
(don't forget to update your cocoapods master repo)
For swift 4.2 version use 011f7090e69a8446aadd21531e4b83da745cd2d4
in master
branch.
If you're still using Swift 2.x - you can set (The development for swift_2.x is deprecated. Stale version still exists.)
Usage
- Make your UITextField a class of NKVPhonePickerTextField
- Set its phonePickerDelegate to UIViewController in order to be able of presenting the CountriesViewController
- If any troubles - watch an example project.
Please, make an issue, if you need any features, or have bugs.
Example
Note: 'In this library used the TextFieldPatternFormat
lib by Vojta Stavik'
TODO:
- [x] Add example
- [x] Max numbers count var (can do with custom pattern)
- [x] Patterns for each country