GCCountryPicker

2.5.0

A localized, searchable country picker view controller with optional calling codes for iOS 9+ written in Swift.
graycampbell/GCCountryPicker

What's New

Version 2.5.0

2019-03-28T02:07:42Z

Release Notes

  • Updates project to Swift 5.0.

banner

Release CocoaPods Documentation Codacy Code Quality Swift 4 Compatible Platform License

CocoaPods

pod 'GCCountryPicker'

Implementation

  1. Add GCCountryPicker to your file's import statements.

    import GCCountryPicker
    
  2. Create an instance of GCCountryPickerViewController.

    let countryPickerViewController = GCCountryPickerViewController(displayMode: .withoutCallingCodes)
    
  3. Set the delegate, data source (optional), and navigation title.

    countryPickerViewController.delegate = self
    countryPickerViewController.dataSource = self
    countryPickerViewController.navigationItem.title = "Countries"
    
  4. Embed the country picker view controller in a navigation controller.

    let navigationController = UINavigationController(rootViewController: countryPickerViewController)
    
  5. Present the navigation controller.

    self.present(navigationController, animated: true, completion: nil)
    
  6. Implement GCCountryPickerDelegate.

    func countryPickerDidCancel(_ countryPicker: GCCountryPickerViewController)
    
    func countryPicker(_ countryPicker: GCCountryPickerViewController, didSelectCountry country: GCCountry)
    
  7. Implement GCCountryPickerDataSource if necessary.

    func countryCodes(for countryPicker: GCCountryPickerViewController) -> [String]
    

Documentation

License

GCCountryPicker is available under the MIT license. See the LICENSE file for more info.

Description

  • Swift Tools 4.0.0
View More Packages from this Author

Dependencies

  • None
Last updated: Wed Mar 13 2024 03:50:02 GMT-0900 (Hawaii-Aleutian Daylight Time)