AGCountryCode
安装
AGCustomControls 可通过 CocoaPods 获得。要安装它,只需将以下行添加到 Podfile 即可
pod 'AGCountryCode'
描述
这是一个自定义 UIPickerView,用于向用户提供一个国家列表。
使用方法
为了创建一个视图来显示国家选择器
let countryView = AGCountryCodeView()
CountryPickerViewDelegate 会在用户选择国家时通知
public protocol AGCountryCodeViewDelegate {
/// Every time the user selects a country, the delegate will call this function.
///
/// - Parameters:
/// - view: Sender (AGCountryCodeView)
/// - countryName: The name of the country selected
/// - countryCode: The code of the country selected
/// - countryDialCode: The dial code of the country selected
/// - flag: The flag of the country selected
func countryPickerSelectedCountry(view: AGCountryCodeView,
countryName:String?,
countryCode:String?,
countryDialCode:String?,
flag:UIImage?)
}
屏幕截图
作者
Antonio González, [email protected]
许可证
AGCountryCode 使用MIT许可证。有关更多信息,请参阅LICENSE文件。