All Projects → NikKovIos → Nkvphonepicker

NikKovIos / Nkvphonepicker

Licence: mit
An UITextField subclass to simplify country code's picking. Swift 5.0

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Nkvphonepicker

Countrypickerview
A simple, customizable view for efficiently collecting country information in iOS apps.
Stars: ✭ 397 (+203.05%)
Mutual labels:  phone, country, picker
PhoneCountryCodePicker
An iOS tableview picker for PhoneCountryCode (English & Chinese supported)
Stars: ✭ 31 (-76.34%)
Mutual labels:  phone, country, picker
PhoneNumberKit
Android Kotlin library to parse and format international phone numbers. Country code picker.
Stars: ✭ 124 (-5.34%)
Mutual labels:  phone, picker
csc picker
A flutter package to display a country, states, and cities. In addition it gives the possibility to select a list of countries, States and Cities depends on Selected, also you can search country, state, and city all around the world.
Stars: ✭ 25 (-80.92%)
Mutual labels:  country, picker
Flagphonenumber
A formatted phone number UITextField with country flag picker.
Stars: ✭ 371 (+183.21%)
Mutual labels:  country, picker
Qpdialcodepickerview
International Dial Code Picker View for Country or Area 国家或地区国际区号选择器
Stars: ✭ 15 (-88.55%)
Mutual labels:  country, picker
Kotlin Playground
Kotlin practice
Stars: ✭ 111 (-15.27%)
Mutual labels:  example, picker
Calendar
📆 calendar 日历
Stars: ✭ 119 (-9.16%)
Mutual labels:  picker
Eshoponcontainersddd
Fork of dotnet-architecture/eShopOnContainers in full DDD/CQRS design using my own patterns
Stars: ✭ 126 (-3.82%)
Mutual labels:  example
Datepicker
仿滴滴出行预约打车IOS风格3D时间选择器 🌲
Stars: ✭ 118 (-9.92%)
Mutual labels:  picker
Examples Of Web Crawlers
一些非常有趣的python爬虫例子,对新手比较友好,主要爬取淘宝、天猫、微信、豆瓣、QQ等网站。(Some interesting examples of python crawlers that are friendly to beginners. )
Stars: ✭ 10,724 (+8086.26%)
Mutual labels:  example
Cypress Example Docker Circle
Cypress + Docker + CircleCI = ❤️
Stars: ✭ 119 (-9.16%)
Mutual labels:  example
Distpicker
⚠️ [Deprecated] No longer maintained. A simple jQuery plugin for picking provinces, cities and districts of China. (中国 / 省市区 / 三级联动 / 地址选择器)
Stars: ✭ 1,608 (+1127.48%)
Mutual labels:  picker
Distancepicker
Custom UIKit control to select a distance with a pan gesture, written in Swift
Stars: ✭ 118 (-9.92%)
Mutual labels:  picker
Scrapy demo
all kinds of scrapy demo
Stars: ✭ 128 (-2.29%)
Mutual labels:  example
Razzle Material Ui Styled Example
Razzle Material-UI example with Styled Components using Express with compression
Stars: ✭ 117 (-10.69%)
Mutual labels:  example
Express Env Example
A sample express environment that is well architected for scale. Read about it here:
Stars: ✭ 130 (-0.76%)
Mutual labels:  example
Ngx Validators
Validator library for Angular 2+
Stars: ✭ 128 (-2.29%)
Mutual labels:  phone
Pingplacepicker
An almost plug and play replacement for Google's Place Picker
Stars: ✭ 124 (-5.34%)
Mutual labels:  picker
Belvedere
An image picker library for Android
Stars: ✭ 122 (-6.87%)
Mutual labels:  picker


Platform Swift version License
CocoaPods CocoaPods

Preview


Installation

NKVPhonePicker is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'NKVPhonePicker'

Also you can try an example project with

pod try NKVPhonePicker

(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.)

pod 'NKVPhonePicker', :git => "https://github.com/NikKovIos/NKVPhonePicker.git", :branch => "Swift_2.x"

Usage

  1. Make your UITextField a class of NKVPhonePickerTextField
  2. Set its phonePickerDelegate to UIViewController in order to be able of presenting the CountriesViewController
  3. If any troubles - watch an example project.

Please, make an issue, if you need any features, or have bugs.

Example

topTextField.phonePickerDelegate = self
topTextField.favoriteCountriesLocaleIdentifiers = ["RU", "ER", "JM"]
topTextField.rightToLeftOrientation = true
topTextField.shouldScrollToSelectedCountry = false
topTextField.flagSize = CGSize(width: 30, height: 50)
topTextField.enablePlusPrefix = false

// Setting initial custom country
let country = Country.countryBy(countryCode: "EG")
topTextField.currentSelectedCountry = country

// Setting custom format pattern for some countries
topTextField.customPhoneFormats = ["RU" : "# ### ### ## ##",
                                   "GB": "## #### #########"]

// Adding programmatically
bottomTextField = NKVPhonePickerTextField(frame: CGRect(x: 0, y: 0, width: 0, height: 30))
bottomTextField.placeholder = "ex: 03123456"
bottomTextField.autocorrectionType = .no
bottomTextField.phonePickerDelegate = self
bottomTextField.keyboardType = .numberPad
bottomTextField.favoriteCountriesLocaleIdentifiers = ["LB"]
bottomTextField.layer.borderWidth = 1
bottomTextField.layer.borderColor = UIColor.white.cgColor
bottomTextField.layer.cornerRadius = 5
bottomTextField.font = UIFont.boldSystemFont(ofSize: 25)
bottomTextField.textColor = UIColor.white
bottomTextField.textFieldTextInsets = UIEdgeInsets(top: 0, left: 20, bottom: 0, right: 0)
bottomTextField.translatesAutoresizingMaskIntoConstraints = false

// prefilling
let source = NKVSource(countryCode: "ru")
bottomTextField.setCurrentCountryInitially = false
bottomTextField.preFillText(source: source, number: 7999432423)

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

Checkout my other works

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].