Add GCCountryPicker to your file’s import statements.
import GCCountryPicker
Create an instance of GCCountryPickerViewController.
let countryPickerViewController = GCCountryPickerViewController(displayMode: .withoutCallingCodes)
Set the delegate, data source (optional), and navigation title.
countryPickerViewController.delegate = self
countryPickerViewController.dataSource = self
countryPickerViewController.navigationItem.title = "Countries"
Embed the country picker view controller in a navigation controller.
let navigationController = UINavigationController(rootViewController: countryPickerViewController)
Present the navigation controller.
self.present(navigationController, animated: true, completion: nil)
Implement GCCountryPickerDelegate.
func countryPickerDidCancel(_ countryPicker: GCCountryPickerViewController)
func countryPicker(_ countryPicker: GCCountryPickerViewController, didSelectCountry country: GCCountry)
Implement GCCountryPickerDataSource if necessary.
func countryCodes(for countryPicker: GCCountryPickerViewController) -> [String]
CocoaPods
Implementation
Add GCCountryPicker to your file’s import statements.
Create an instance of GCCountryPickerViewController.
Set the delegate, data source (optional), and navigation title.
Embed the country picker view controller in a navigation controller.
Present the navigation controller.
Implement GCCountryPickerDelegate.
Implement GCCountryPickerDataSource if necessary.
Documentation
Classes
Enumerations
Protocols
License
GCCountryPicker is available under the MIT license. See the LICENSE file for more info.