轻松简化国家/地区选择。自定义主题,添加国家/地区,并优化列表——所有这些都针对您的应用程序进行定制。一个简单而强大的选择,以增强用户体验。 🌐✨
如果它简化了您的应用程序开发,请给它一个⭐️!
https://github.com/aksamitsah/CountryPickerAKS.git
Up to Next Major
(更新到下一个主版本)以获取最新更新source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '12.0'
use_frameworks!
target 'MyApp' do
pod 'CountryPickerAKS'
end
import CountryPickerAKS
CountryPicker.show(from: self) { result in
switch result {
case .success(let data):
debugPrint(data)
case .failure(let err):
debugPrint(err.localizedDescription)
}
}
借助强大的选项,您可以使用 CountryPickerAKS 以简单的方式完成复杂的任务。 例如,以下代码
config
参数即可。CountryPicker.show(from: self, config: Config(
display: ShowContent(Flag: true, CountryName: true)
)) { result in
switch result {
case .success(let data):
debugPrint(data)
case .failure(let err):
debugPrint(err.localizedDescription)
}
}
CountryPicker.show(from: self, config: Config(
color: ThemeColor(
primary: .systemGray6,
secondary: .systemBackground,
textColor: .systemBlue)
)) { result in
switch result {
case .success(let data):
debugPrint(data)
case .failure(let err):
debugPrint(err.localizedDescription)
}
}
CountryPicker.show(from: self, config: Config(
font: ThemeFont(
searchBar: UIFont(name: "Lemonada-Medium", size: 16) ?? UIFont(),
countryName: UIFont(name: "Lemonada-Regular", size: 16) ?? UIFont(),
countryCode: UIFont(name: "Lemonada-Light", size: 16) ?? UIFont(),
countryFlag: UIFont(name: "Lemonada-Bold", size: 22) ?? UIFont())
)) { result in
switch result {
case .success(let data):
debugPrint(data)
case .failure(let err):
debugPrint(err.localizedDescription)
}
}
CountryPicker.show(from: self, config: Config(
data: CustomizeCountryList(showLocalOnTop: false)
)) { result in
switch result {
case .success(let data):
debugPrint(data)
case .failure(let err):
debugPrint(err.localizedDescription)
}
}
CountryPicker.show(from: self, config: Config(
data: CustomizeCountryList(
addNew: [
CountryList(name: "New Country", dial_code: "+12", emoji: "🫡", code: "NCA"),
CountryList(name: "New Country B", dial_code: "+13", emoji: "😵💫", code: "NCB")
],
alterExisting: [
.onTop(["NCA", "NCB"]),
.onTopAfterLocal(["NP"]),
.onBottom(["US"])
]
)
)) { result in
switch result {
case .success(let data):
debugPrint(data)
case .failure(let err):
debugPrint(err.localizedDescription)
}
}
.displayOnly([code])
国家/地区:用于仅显示国家/地区列表。.removeOnly([code])
国家/地区:用于删除特定国家/地区。CountryPicker.show(from: self, config: Config(
data: CustomizeCountryList(
addNew: [
CountryList(name: "New Country", dial_code: "+12", emoji: "🫡", code: "NCA"),
CountryList(name: "New Country B", dial_code: "+13", emoji: "😵💫", code: "NCB")
],
alterExisting: [
.onTop(["NCA", "NCB"]),
.onTopAfterLocal(["NP"]),
.onBottom(["US"]),
.displayOnly(["NCA","NCB"]),
.removeOnly(["NCB"])
]
)
)) { result in
switch result {
case .success(let data):
debugPrint(data)
case .failure(let err):
debugPrint(err.localizedDescription)
}
}