Open marbetschar opened 7 years ago
@mats-claassen any thoughts on this proposal?
I think it makes sense and it would be a very nice feature.
One thing that we have to decide is if the country value must be a country picked from the country picker or if we also want to support text input as it is now. Maybe we could support both and then PostalAddress.country
would be an enum like:
enum PostalAddressCountry {
case userInput(country: String)
case isoCode(code: String)
}
This would be similar to the implementation of GooglePlacesRow
Also the SelectorViewController
should be customizable. Ideally we should be able to specify the controller to be used for this.
And as you pointed out the countries names should be localized somehow.
What would be the best approach in adding a country picker to the
PostalAddressRow
?My idea right now is:
UIButton
namedcountryButton
which can be used in aNIB
instead ofcountryTextField
.PostalAddressRow.dataProvider
as selectable default valuesSelectorViewController
for the currentPostalAddressRow
if thecountryButton
is tappedSelectorViewController
in thePostalAddress.country
field of the rowSelectorViewController
countryButton
based upon thePostalAddress.country
field