Open
Conversation
Rashidium
requested changes
Nov 29, 2023
Contributor
Rashidium
left a comment
There was a problem hiding this comment.
Hello @emoonadev ,
Thank you for your contribution. I liked the idea of your request feature. I'm sure it'll be useful for the community.
I've some comments though, to kindly ask you to make some changes on the implementation. New feature brings some if-else's which can lead to messy code base in the future. To avoid, we can create 2 different structs conforming to the same protocol, to be more specific, ListItem protocol children, Country and Currency.
ListItem, should have some common items for both Country and Currency.
- code: currently isoCode and currencyCode respectively. Here I would like you to confirm whether isoCode and currencyCode are same? As they both use
.getFlagfunction. If they're same, let's use same value for both. - name: currently localizedName, localizedCurrencyName
- currencyCode: currently +phoneCode and currencyCode+currencySymbol
After this, removing picker mode from TableViewCell would be logical and some refactorings on CountryPickerViewController will be necessary.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new mode to the existing Country Code Picker screen that allows it to function as a Currency Picker. This dual functionality enhances user flexibility, enabling seamless switching between selecting country codes and currencies within the same interface.
Key Changes:
This feature aims to improve user experience by providing a more versatile and efficient interface for selecting country-specific details.
To use it simply use the new init: