{"id":19312071,"url":"https://github.com/weblineindia/ios-country-code-picker","last_synced_at":"2025-08-22T13:32:45.410Z","repository":{"id":129984628,"uuid":"277764051","full_name":"weblineindia/iOS-Country-Code-Picker","owner":"weblineindia","description":"This is a iOS based CountryCode Picker which allows user to select country and enter mobile number.","archived":false,"fork":false,"pushed_at":"2022-10-29T11:28:43.000Z","size":507,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-19T13:35:40.456Z","etag":null,"topics":["country-code","country-code-picker","country-picker","countrycode-picker","ios","ios-component","ios-country-code","ios-demo","ios-developer-tools","ios-package","ios-swift","ios-swift-demos","picker-component","picker-demo","picker-library","swift-components","swift-country-code-picker","swift-library","swift-packages"],"latest_commit_sha":null,"homepage":"https://www.weblineindia.com/software-development-resources.html","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/weblineindia.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-07-07T08:44:16.000Z","updated_at":"2024-02-15T02:33:42.000Z","dependencies_parsed_at":"2023-04-15T04:16:49.601Z","dependency_job_id":null,"html_url":"https://github.com/weblineindia/iOS-Country-Code-Picker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weblineindia%2FiOS-Country-Code-Picker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weblineindia%2FiOS-Country-Code-Picker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weblineindia%2FiOS-Country-Code-Picker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weblineindia%2FiOS-Country-Code-Picker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/weblineindia","download_url":"https://codeload.github.com/weblineindia/iOS-Country-Code-Picker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250267347,"owners_count":21402460,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["country-code","country-code-picker","country-picker","countrycode-picker","ios","ios-component","ios-country-code","ios-demo","ios-developer-tools","ios-package","ios-swift","ios-swift-demos","picker-component","picker-demo","picker-library","swift-components","swift-country-code-picker","swift-library","swift-packages"],"created_at":"2024-11-10T00:32:36.608Z","updated_at":"2025-04-22T15:31:40.127Z","avatar_url":"https://github.com/weblineindia.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# iOS Country Code Picker\n\nThis is a iOS based CountryCode Picker which allows user to select country and enter mobile number.\n\n## Table of contents\n- [iOS Support](#iOS-support)\n- [Demo](#demo)\n- [Features](#features)\n- [Getting started](#getting-started)\n- [Usage](#usage)\n- [Methods](#methods)\n- [Want to Contribute?](#want-to-contribute)\n- [Need Help / Support?](#need-help)\n- [Collection of Components](#collection-of-Components)\n- [Changelog](#changelog)\n- [License](#license)\n- [Keywords](#Keywords)\n\n\n## iOS Support\n\nMinimum iOS Target 13.0\n\n\n## Demo\n[![](CountryPicker.png)](https://github.com/weblineindia/iOS_Country_Code_Picker/blob/master/CountryPicker.png)\n\n------\n\n## Features\n* Select country with flag \u0026 country code\n\n## Getting started\nDownload this project and import required files in your project\n\n## Usage\nSetup below configuration in your base viewcontroller \n\n### Create object of  CountriesViewController \n\n    Create object of  CountriesViewController \n    For Example,\n     var countriesViewController = CountriesViewController()\n \n ### Setup for opening country picker\n e.g.\n \n  @IBAction func btnCountryPicker(_ sender: UIButton) {\n  \n        DispatchQueue.main.async {\n            CountriesViewController.show(countriesViewController: self.countriesViewController, toVar: self)\n        }\n    }\n \n ### Setup delegate and implement methods for call back selected country details\n\n1. Will call when multiple countries can be selected\n    func countriesViewController(_ countriesViewController: CountriesViewController, didSelectCountries countries: [Country]) \n2. Will call when user cancel and close country picker\n   func countriesViewControllerDidCancel(_ countriesViewController: CountriesViewController) \n3. Will call when country is selected\n   func countriesViewController(_ countriesViewController: CountriesViewController, didSelectCountry country: Country)\n4. Will call when user deselect country \nfunc countriesViewController(_ countriesViewController: CountriesViewController, didUnselectCountry country: Country)\n\n### Setup your base class by extending your class with Delegate class\ne.g.\n\n    func setupCountryPicker(){\n       self.countriesViewController = CountriesViewController()\n       self.countriesViewController.delegate = self\n       self.countriesViewController.allowMultipleSelection = false\n       if let info = self.getCountryAndName() {\n           countryCode = info.countryCode!\n           self.lblFlag.text = info.countryFlag!\n           self.lblCountryCode.text = info.countryCode!\n       }\n    }\n\n### Create a Countries class which contain array of Country Object\ne.g.\n\n    var countries: [Country] = []\n    countries.append(Country(countryCode: \"AF\", phoneExtension: \"93\", isMain: true, flag: emojiFlag(countryCode: \"AF\")))\n\n### Create a method for converting countryCode to unichar string \ne.g.\n\n    open class func emojiFlag(countryCode: String) -\u003e String {\n    let base : UInt32 = 127397\n    var string = \"\"\n    let country = countryCode.uppercased().unicodeScalars\n    for uS in country {\n        print(\"country code:\\(countryCode.uppercased())---\\(UnicodeScalar(base + uS.value)!)\")\n        string.unicodeScalars.append(UnicodeScalar(base + uS.value)!)\n    }\n\n    return string\n}\n### Create  CountryModel object for store last selected country details\n    var selectedCountry:CountryModel?\n\n\n## Methods\n\n### Create a method for selected country details\n\n    private func getCountryAndName(_ countryParam: String? = nil) -\u003e CountryModel?\n\n\n### Create a method for phone number validation\n\n    func isValidPhone(phone: String) -\u003e Bool {\n        let phoneRegex = \"^[0-9+]{0,1}+[0-9]{9}$\"\n        let phoneTest = NSPredicate(format: \"SELF MATCHES %@\", phoneRegex)\n        return phoneTest.evaluate(with: phone)\n    }\n \n ------\n \n## Want to Contribute?\n\n- Created something awesome, made this code better, added some functionality, or whatever (this is the hardest part).\n- [Fork it](http://help.github.com/forking/).\n- Create new branch to contribute your changes.\n- Commit all your changes to your branch.\n- Submit a [pull request](http://help.github.com/pull-requests/).\n\n ------\n\n## Need Help? \nWe also provide a free, basic support for all users who want to use this country picker demo in project. In case you want to customize this country picker demo input to suit your development needs, then feel free to contact our [iOS\ndevelopers](https://www.weblineindia.com/hire-ios-app-developers.html).\n\n ------\n \n ## Collection of Components\n We have built many other components and free resources for software development in various programming languages. Kindly click here to view our [Free Resources for Software Development.](https://www.weblineindia.com/software-development-resources.html)\n \n------\n\n## Changelog\n\n Detailed changes for each release are documented in [CHANGELOG](./CHANGELOG).\n\n## License\n\n [MIT](LICENSE)\n\n [mit]: https://github.com/weblineindia/iOS_Country_Code_Picker/blob/master/LICENSE\n\n## Keywords\n\n Country Code, Country Code Picker, Picker demo, Country Picker ,WeblineIndia \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweblineindia%2Fios-country-code-picker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fweblineindia%2Fios-country-code-picker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweblineindia%2Fios-country-code-picker/lists"}