Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Country picker #3

Open
marbetschar opened this issue Dec 13, 2016 · 2 comments
Open

Country picker #3

marbetschar opened this issue Dec 13, 2016 · 2 comments

Comments

@marbetschar
Copy link

marbetschar commented Dec 13, 2016

What would be the best approach in adding a country picker to the PostalAddressRow?

My idea right now is:

  1. Add a UIButton named countryButton which can be used in a NIB instead of countryTextField.
  2. Assign all country iso codes to the PostalAddressRow.dataProvider as selectable default values
  3. Show a SelectorViewController for the current PostalAddressRow if the countryButton is tapped
  4. Store the selected country code of the SelectorViewController in the PostalAddress.country field of the row
  5. Dismiss the SelectorViewController
  6. Display the localized country name as label of the countryButton based upon the PostalAddress.country field
@marbetschar
Copy link
Author

@mats-claassen any thoughts on this proposal?

@mats-claassen
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants