To run the example project, clone the repo, and run pod install
from the Example directory first.
A list of countries with flags and phone codes.
A single UIViewController with UITableView that display list of countries for selection.
AYCountries is available through CocoaPods. To install it, simply add the following line to your Podfile:
inhibit_all_warnings!
target 'YOUR-TARGET-NAME' do
use_frameworks!
pod 'AYCountries'
end
// 'country' - object of class 'AYCountry' (selected country).
// 'vc' - object of class 'UIViewController' (countries list).
// 'countriesViewController' - created object of class 'UIViewController' with list of countries.
let countriesViewController = AYCountriesConfigurator.configure { [weak self] country, vc in
print(country?.name)
vc.dismiss(animated: true, completion: nil)
}
present(countriesViewController, animated: true, completion: nil)
countriesViewController.fetch(with: Query.name("ukr")) // fetch countries that contains 'ukr' in the name (case insensitive)
Anton Yereshchenko
AYCountries is available under the MIT license. See the LICENSE file for more info.