{"id":15038130,"url":"https://github.com/4taras4/countrycode","last_synced_at":"2025-04-05T06:09:17.913Z","repository":{"id":45682961,"uuid":"75409822","full_name":"4taras4/CountryCode","owner":"4taras4","description":" 🎯 Swift country and phone code Picker","archived":false,"fork":false,"pushed_at":"2024-04-24T09:35:00.000Z","size":1321,"stargazers_count":216,"open_issues_count":1,"forks_count":74,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-05T06:09:11.447Z","etag":null,"topics":["cocoapods","countries","countrypicker","flags","ios","phonecode","phonepicker","picker","swift","swift4","swift5","uipickerview"],"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/4taras4.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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}},"created_at":"2016-12-02T15:57:24.000Z","updated_at":"2024-11-18T05:48:32.000Z","dependencies_parsed_at":"2024-04-24T10:48:16.371Z","dependency_job_id":"1ac3a066-587a-425b-9d32-30749891229f","html_url":"https://github.com/4taras4/CountryCode","commit_stats":{"total_commits":130,"total_committers":14,"mean_commits":9.285714285714286,"dds":"0.23076923076923073","last_synced_commit":"5397b89b5cd280d82bfae1d974147f999bc3af45"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4taras4%2FCountryCode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4taras4%2FCountryCode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4taras4%2FCountryCode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4taras4%2FCountryCode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/4taras4","download_url":"https://codeload.github.com/4taras4/CountryCode/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247294541,"owners_count":20915340,"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":["cocoapods","countries","countrypicker","flags","ios","phonecode","phonepicker","picker","swift","swift4","swift5","uipickerview"],"created_at":"2024-09-24T20:37:13.716Z","updated_at":"2025-04-05T06:09:17.893Z","avatar_url":"https://github.com/4taras4.png","language":"Swift","readme":"# CountryPicker\n\n[![Swift Package Manager compatible](https://img.shields.io/badge/Swift%20Package%20Manager-compatible-brightgreen.svg)](https://github.com/apple/swift-package-manager)\n[![Build Status](https://travis-ci.org/4taras4/CountryCode.svg?branch=master)](https://travis-ci.org/4taras4/CountryCode)\n[![Platform](https://img.shields.io/cocoapods/p/CountryPicker.svg?style=flat)](https://cocoapods.org/pods/CountryPickerSwift)\n[![Swift version](https://img.shields.io/badge/Swift-3.1-orange.svg)](https://cocoapods.org/pods/CountryPickerSwift)\n[![Swift version](https://img.shields.io/badge/Swift-4-orange.svg)](https://cocoapods.org/pods/CountryPickerSwift)\n[![Beerpay](https://beerpay.io/4taras4/CountryCode/badge.svg?style=flat)](https://beerpay.io/4taras4/CountryCode)\n\nPicker code  Swift 3 / 4 / 5.\n\n## Example\nTo run the example project, clone the repo, and run `pod install` from the Example directory first. \n![1](https://github.com/4taras4/CountryCode/blob/master/bin/screenShot.png)\n\n\n## Usage\n\nMake your UIPickerView a class of CountryPicker, set its countryPickerDelegate and implement its countryPhoneCodePicker method.\n\nExample:\n\n```swift\nimport CountryPicker\n\nclass ViewController: UIViewController, CountryPickerDelegate {\n\n    @IBOutlet weak var picker: CountryPicker!\n   \n    \n    override func viewDidLoad() {\n        super.viewDidLoad()\n       //get current country\n        let locale = Locale.current\n        let code = (locale as NSLocale).object(forKey: NSLocale.Key.countryCode) as! String?\n        //init Picker\n        picker.displayOnlyCountriesWithCodes = [\"DK\", \"SE\", \"NO\", \"DE\"] //display only\n        picker.exeptCountriesWithCodes = [\"RU\"] //exept country\n        let theme = CountryViewTheme(countryCodeTextColor: .white, countryNameTextColor: .white, rowBackgroundColor: .black, showFlagsBorder: false)        //optional for UIPickerView theme changes\n        picker.theme = theme //optional for UIPickerView theme changes\n        picker.countryPickerDelegate = self\n        picker.showPhoneNumbers = true\n        picker.setCountry(code!)\n\n    }\n    \n    // a picker item was selected\n    func countryPhoneCodePicker(_ picker: CountryPicker, didSelectCountryWithName name: String, countryCode: String, phoneCode: String, flag: UIImage) {\n       //pick up anythink\n      code.text = phoneCode\n    }\n\n}\n```\n\n## Integration\n\n#### CocoaPods (iOS 8+, OS X 10.9+)\n\nCountryPicker is available through [CocoaPods](http://cocoapods.org). To install\n\n*Swift 4-5  (Xcode 10+)*  `pod 'CountryPickerSwift', '1.8'`\n\n*Swift 3.1 (Xcode 9)*  `pod 'CountryPickerSwift', '1.7'`\n\n*Swift 3.0+ (Xcode 8)*  `pod 'CountryPickerSwift', '1.4.4'`\n\nit, simply add the following line to your 'Podfile':\n\n```ruby\nplatform :ios, '8.0'\nuse_frameworks!\n\ntarget 'MyApp' do\n    pod 'CountryPickerSwift'\nend\n```\n\n#### Swift Package Manager\n\nYou can use [The Swift Package Manager](https://swift.org/package-manager) to install `CountryPicker` by adding the proper description to your `Package.swift` file:\n\n```swift\nAdd package:     https://github.com/4taras4/CountryCode\n\n```\n\nNote that the [Swift Package Manager](https://swift.org/package-manager) is still in early design and development, for more information checkout its [GitHub Page](https://github.com/apple/swift-package-manager)\n\n#### Manually\n\nTo use this library in your project manually just drag and drop CountryPicker folder to your project.\n\n## Author\n\n4taras4, 4taras4@gmail.com\n\n## License\n\nCountryPicker is available under the MIT license. See the LICENSE file for more info.\n[release-link](https://github.com/4taras4/CountryCode/releases/latest)\n\n\n## Donate\n\n Donation Bitcoin 141Q3KduSqvTtMbrU6YouSErDBh1SpiLrL \n\n\n## Support on Beerpay\nHey dude! Help me out for a couple of :beers:!\n\n[![Beerpay](https://beerpay.io/4taras4/CountryCode/badge.svg?style=beer-square)](https://beerpay.io/4taras4/CountryCode)  [![Beerpay](https://beerpay.io/4taras4/CountryCode/make-wish.svg?style=flat-square)](https://beerpay.io/4taras4/CountryCode?focus=wish)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F4taras4%2Fcountrycode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F4taras4%2Fcountrycode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F4taras4%2Fcountrycode/lists"}