-
Notifications
You must be signed in to change notification settings - Fork 286
Fix/4235 – Consistent Sorting Of Countries – Alphabetically #1680
Fix/4235 – Consistent Sorting Of Countries – Alphabetically #1680
Conversation
@@ -8,7 +8,7 @@ import UIKit | |||
struct ExposureSubmissionQRInfoViewModel { | |||
|
|||
init(supportedCountries: [Country]) { | |||
countries = supportedCountries | |||
countries = supportedCountries.sorted { $0.localizedName.localizedCompare($1.localizedName) == .orderedAscending } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we put this in an Extension for [Country] ?
extension Array where Element : Country
Something along those lines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool idea 👍
Done with 8058e6e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix!
Could you please add a simple unit test? Maybe "Germany, Spain and the Netherlands" ordered in these languages. The ordering should change, based on a quick guesstimation from this list of translated country names.
Co-authored-by: Nick Guendling <hello@nickguendling.com>
Added a unit test for sorting countries based on localized country names for all supported languages. |
Description
Fixes the inconsistent sorting of country list.
Spec: sort alphabetically.
Link to Jira
https://jira-ibs.wbs.net.sap/browse/EXPOSUREAPP-4235
Screenshots