{"id":2682,"url":"https://github.com/SURYAKANTSHARMA/CountryPicker","last_synced_at":"2025-08-03T00:32:30.481Z","repository":{"id":43612966,"uuid":"108647439","full_name":"SURYAKANTSHARMA/CountryPicker","owner":"SURYAKANTSHARMA","description":"A simple, customizable Country picker for picking country or dialing code. 🇮🇳 🇯🇵 🇰🇷 🇩🇪 🇨🇳 🇺🇸 🇫🇷 🇪🇸 🇮🇹 🇷🇺 🇬🇧 ","archived":false,"fork":false,"pushed_at":"2024-10-30T06:43:40.000Z","size":127800,"stargazers_count":298,"open_issues_count":0,"forks_count":86,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-11-30T18:17:14.633Z","etag":null,"topics":["carthage","cocoapods","country-flags","country-picker","country-selection","countrycodes","countrylist","countrypicker","darkmode-ios13","dialing","filter-countries","filter-options","hacktoberfest","ios","ios16","ipados","spm","swift","swift5","xcode"],"latest_commit_sha":null,"homepage":"","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/SURYAKANTSHARMA.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2017-10-28T12:31:36.000Z","updated_at":"2024-10-30T06:43:45.000Z","dependencies_parsed_at":"2024-06-18T15:26:30.483Z","dependency_job_id":"31d16ec8-f223-425f-a629-40fdef1e8bdd","html_url":"https://github.com/SURYAKANTSHARMA/CountryPicker","commit_stats":{"total_commits":306,"total_committers":23,"mean_commits":"13.304347826086957","dds":"0.39542483660130723","last_synced_commit":"3f3383fd2767ffffb0119b40ed4404fb60100872"},"previous_names":[],"tags_count":39,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SURYAKANTSHARMA%2FCountryPicker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SURYAKANTSHARMA%2FCountryPicker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SURYAKANTSHARMA%2FCountryPicker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SURYAKANTSHARMA%2FCountryPicker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SURYAKANTSHARMA","download_url":"https://codeload.github.com/SURYAKANTSHARMA/CountryPicker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228510787,"owners_count":17931765,"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":["carthage","cocoapods","country-flags","country-picker","country-selection","countrycodes","countrylist","countrypicker","darkmode-ios13","dialing","filter-countries","filter-options","hacktoberfest","ios","ios16","ipados","spm","swift","swift5","xcode"],"created_at":"2024-01-05T20:16:20.057Z","updated_at":"2025-08-03T00:32:30.441Z","avatar_url":"https://github.com/SURYAKANTSHARMA.png","language":"Swift","funding_links":[],"categories":["UI"],"sub_categories":["PickerView"],"readme":"![CountryPicker](https://user-images.githubusercontent.com/6416095/50628070-6fe1fd00-0f5c-11e9-9e9b-7e6dac866d43.png)\n\n# CountryPicker\n[![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/vsouza/awesome-ios)\n[![Build Status](https://img.shields.io/badge/Build-failed-red)](https://github.com/SURYAKANTSHARMA/CountryPicker/actions)\n\n\u003c!-- Your project description and other contents below --\u003e\n\n[![codecov](https://codecov.io/gh/SURYAKANTSHARMA/CountryPicker/branch/master/graph/badge.svg)](https://codecov.io/gh/SURYAKANTSHARMA/CountryPicker)\n![Version Badge](https://img.shields.io/github/v/release/SURYAKANTSHARMA/CountryPicker?style=flat)\n\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n[![Swift Package Manager compatible](https://img.shields.io/badge/Swift%20Package%20Manager-compatible-brightgreen.svg)](https://github.com/apple/swift-package-manager)\n[![License](https://img.shields.io/badge/License-MIT-8D6E63.svg)](LICENSE)  \n\n\nCountryPicker is a Swift library that provides a simple and easy-to-use interface for selecting countries from a predefined list. It's perfect for adding country selection functionality to your iOS app with minimal effort.\n\n\n## If you like CountryPicker, give it a ★ at the top right of this page.\n\n## Features\n\n- [x] Navigate through search and index title of section e.g (in Contact app in iOS)\n- [x] Auto scroll to previous selected country\n- [x] Filtering country options\n- [x] Styling view options\n- [x] Image size are optimized\n- [x] Cocoa Pods integrated\n- [x] Carthage integrated\n- [x] Swift package manager integrated\n- [x] Best practices followed\n- [x] Dark mode supported \n- [x] Support Dynamic font size for ContentSizeCategory\n- [x] Unit tests coverage 94%\n- [x] Picker view support added with customization \n- [x] Swift UI Support with example project\n- [x] Rewritten with swiftUI and combine in version 3.0.0  \n## Requirements\n\n- iOS 15.0+ Support latest release iOS 17 for older user older than 3.0.0\n- latest Xcode 15.x with Swift \n\n## Demo Project\nTo run the example project, clone the repo, and run pod update from the Example directory first.\n\n\u003cimg src= \"Usage Resource/SKCountryPickerDemo.gif\" width=\"200\" height = \"400\"\u003e\n\n#### Swift UI Combine new project \n\u003cimg src= \"Usage Resource/SKCountryPicker15Plus.gif\" width=\"200\" height = \"400\"\u003e|\n\n\n##  \n\n## Screenshots\n| Home Scene        | Country Picker Scene  | Filtering Scene | Dark Mode Scene | Picker View |\n|:-----------------:|:---------------------:|:--------------:|:--------------:|:--------------:|\n|\u003cimg src= \"Usage Resource/SKCountryPickerHomeScene.png\" width=\"166\" height = \"330\"\u003e|\u003cimg src= \"Usage Resource/SKCountryPickerScene.png\" width=\"166\" height = \"330\"\u003e| \u003cimg src= \"Usage Resource/SKCountryPickerFilterScene.png\" width=\"166\" height = \"330\"\u003e| \u003cimg src= \"Usage Resource/DarkMode.png\" width=\"166\" height = \"330\"\u003e|  \u003cimg src= \"Usage Resource/pickerView.png\" width=\"166\" height = \"330\"\u003e|\n\n\n## Installation\n\nCountryPicker is available through Cocoapods and Carthage.\n\n#### [CocoaPods](http://cocoapods.org):\nAdd the following line to your Podfile:\n\n```ruby\nFor iOS 15 and above (Combine and Swiftui version) currently only supported by cocoapods \npod 'SKCountryPicker'\n\n```\n\nPlease note iOS 15 will be discontinued after in 2024. \n#### [Carthage](https://github.com/Carthage/Carthage)\nThe steps required to use Carthage for dependency management are described [here](https://github.com/Carthage/Carthage#getting-started) but lets add them to this README as well for good measure.\n\nFirst you need to add the following line to your Cartfile\n\n```\ngithub \"SURYAKANTSHARMA/CountryPicker\"\n```\n\nto include the latest version of CountryPicker.\n\n(if you don't have a Cartfile, you need to create one first in your favorite texteditor)\n\nNext run\n\n```\ncarthage update --platform iOS\n```\n\nThis will have Carthage:\n- Fetch the source code for CountryPicker from Github\n- Compile the source code into a framework for you to use\n\nonce Carthage finishes building, you need to add the framework to your project.\n\nIn Xcode:\n\n- Navigate to the \"General\" tab of your project and tap the plus sign under \"Frameworks, Libraries and Embedded Content\"\n- Select \"Add other\" and locate the Carthage folder (typically in the root of your project)\n- The SKCountryPicker.framework is located under `Carthage/Build/iOS/`\n- Select it and verify that it is added as a framework.\n\nThe final step is to add the `copy-frameworks` build script to your \"Build Phases\".\n\n- Navigate to \"Build Phases\" and tap the + at the top.\n- Select \"New Run Script Phase\"\n- Paste this line as the script to run `/usr/local/bin/carthage copy-frameworks`\n- Add the SKCountryPicker.framework under Input Files like so: `$(SRCROOT)/Carthage/Build/iOS/SKCountryPicker.framework`\n\nDone!\n\n#### [SPM](https://swift.org/package-manager/)\n\nAdd the following line to your Package.swift file in the dependencies section:\n\n```\n.package(url: \"https://github.com/SURYAKANTSHARMA/CountryPicker.git, from \"4.0.0\")\n```\n\n## Getting Started\nPlease  check [baseiOS11Example](https://github.com/SURYAKANTSHARMA/CountryPicker/tree/master/Examples) project for customization and different option available for using with old uikit.\n\nPlease check [baseiOS15Example](https://github.com/SURYAKANTSHARMA/CountryPicker/tree/master/CountryPickeriOS15%2B/CountryPicker13%2BExample) project for using it in swift ui app with minimum deployment target iOS 15\n\n\n## Filter Options\nThere are 3 main filter options `countryName`, `countryCode`, `countryDialCode` and  by default country picker has been configured to filter countries based on `countryName`.\n\nIf you want to add/remove filter options, do as follows:\n```swift\n\n // Adding filter\n CountryManager.shared.addFilter(.countryCode)\n\n // Removing filter\n CountryManager.shared.removeFilter(.countryCode)\n\n // Removing all filters\n CountryManager.shared.clearAllFilters()\n```\n\nIncase you want to retrieve  `country` info\n```swift\n\n// Get country based on digit code e.g: 60, +255\nCountryManager.shared.country(withDigitCode: \"255\")\n\n// Get country based on country name\nCountryManager.shared.country(withName: \"Tanzania\")\n\n// Get country based on country code e.g: MY, TZ\nCountryManager.shared.country(withCode: \"MY\")\n\n```\n## Dependency Graph \n\n![Dependecy graph](https://user-images.githubusercontent.com/6416095/181878996-43ef2361-5d81-4bef-9f84-f4c54a640ed6.png)\n#### For swift ui \n\n- [x] use 3.0.0 and above version \n\n## Contributing\n\nAny contribution making project better is welcome.\n\n## Authors\n\n[***Suryakant Sharma**](https://github.com/SURYAKANTSHARMA)\n\nSee also the list of [contributors](https://github.com/SURYAKANTSHARMA/CountyPicker/contributors) who participated in this project. Thanks from bottom of my heart to inspiration behind \u003ca href=\"https://github.com/hardeep-singh\"\u003eHardeep Singh\u003c/a\u003e\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSURYAKANTSHARMA%2FCountryPicker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSURYAKANTSHARMA%2FCountryPicker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSURYAKANTSHARMA%2FCountryPicker/lists"}