diff --git a/CountryPickerView.podspec b/CountryPickerView.podspec index d35cbeb..4624fa7 100755 --- a/CountryPickerView.podspec +++ b/CountryPickerView.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |spec| spec.name = "CountryPickerView" - spec.version = "3.0.9" + spec.version = "3.1.0" spec.summary = "A simple, customizable view for selecting countries in iOS apps." spec.homepage = "https://github.com/kizitonwose/CountryPickerView" spec.license = "MIT" diff --git a/CountryPickerView/CountryPickerViewController.swift b/CountryPickerView/CountryPickerViewController.swift index 2e0327b..1a6a519 100644 --- a/CountryPickerView/CountryPickerViewController.swift +++ b/CountryPickerView/CountryPickerViewController.swift @@ -46,14 +46,15 @@ extension CountryPickerViewController { func prepareTableItems() { if !showOnlyPreferredSection { let countriesArray = countryPickerView.countries + let locale = dataSource.localeForCountryNameInList var groupedData = Dictionary(grouping: countriesArray) { - let name = $0.localizedName(dataSource.localeForCountryNameInList) ?? $0.name + let name = $0.localizedName(locale) ?? $0.name return String(name.capitalized[name.startIndex]) } groupedData.forEach{ key, value in groupedData[key] = value.sorted(by: { (lhs, rhs) -> Bool in - return lhs.name < rhs.name + return lhs.localizedName(locale) ?? lhs.name < rhs.localizedName(locale) ?? rhs.name }) } diff --git a/CountryPickerViewDemo/Podfile.lock b/CountryPickerViewDemo/Podfile.lock index 08dd9c5..6dc7b12 100644 --- a/CountryPickerViewDemo/Podfile.lock +++ b/CountryPickerViewDemo/Podfile.lock @@ -1,5 +1,5 @@ PODS: - - CountryPickerView (3.0.8) + - CountryPickerView (3.1.0) DEPENDENCIES: - CountryPickerView (from `../`) @@ -9,7 +9,7 @@ EXTERNAL SOURCES: :path: "../" SPEC CHECKSUMS: - CountryPickerView: d36c6fa3422671b1ba7c4d217e7367ca64de44e2 + CountryPickerView: ab341e2253d5e1231ff679ec93441e413703cb9c PODFILE CHECKSUM: 649829ad9a32abd953e33364dc48a4a40a615047