PostalAddressRow
PostalAddressRow copied to clipboard
Country selector
This pull request adds the ability to define a country selector using the newly added var countrySelectorRow : PushRow<String>?
as discussed in https://github.com/EurekaCommunity/PostalAddressRow/issues/3.
To make use of this you'll define a PostalAddressRow
like this (see the Example project):
<<< PostalAddressRow() {
$0.streetPlaceholder = "Street"
$0.statePlaceholder = "State"
$0.cityPlaceholder = "City"
$0.countryPlaceholder = "Country"
$0.postalCodePlaceholder = "Zip code"
$0.countrySelectorRow = PushRow<String>(){
$0.options = ["GB","US"]
$0.displayValueFor = { guard let isoCode = $0 else{ return nil }
return Locale.current.localizedString(forRegionCode: isoCode)
}
}
}
If you want to use custom Nibs, you'll have to add a UITableView
linked with @IBOutlet open var countrySelectorTableView: UITableView?
.
And this is how it looks like:
Any chance we can get this merged?
Hi @marbetschar, sorry for the late reply.
Why did you use a UITableView with a PushRow instead or a simple button that pushes a SelectorViewController?
@mats-claassen main idea was to provide a way for further customization, using native Eureka features .... but looking back it might not made too much sense probably...?