To run the example project, clone the repo, and run pod install
from the Example directory first.
Library don't depeneds on any third party library.
SwiftyCountryPicker is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'SwiftyCountryPicker'
1- Add a pickerView in your storyBoard. 2- From the attribute inspector set your pickerView class name to
CountryPickerView
3- Create outlet for your countryPicker in ViewController
@IBOutlet weak var pickerView:CountryPickerView!
3- On your view controller add the following code to setup countryPicker
pickerView.setCountryPickerView(hideflag: false, countryName: false, countryCode: false, countrydialCode: false)
4- You can add your own done and cancel button above the picker . On done button press you can call the below closure to get the selected country. and other info.
pickerView.getSelctedCountry { (data) in print(data.countryCode)}
anpkmr, [email protected]
SwiftyCountryPicker is available under the MIT license. See the LICENSE file for more info.