Skip to content

Commit

Permalink
Merge pull request #109 from kizitonwose/dev
Browse files Browse the repository at this point in the history
Release 3.1.0
  • Loading branch information
kizitonwose authored Mar 1, 2020
2 parents 544786e + 6cd7682 commit e218980
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CountryPickerView.podspec
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
5 changes: 3 additions & 2 deletions CountryPickerView/CountryPickerViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,15 @@ extension CountryPickerViewController {
func prepareTableItems() {
if !showOnlyPreferredSection {
let countriesArray = countryPickerView.countries
let locale = dataSource.localeForCountryNameInList

var groupedData = Dictionary<String, [Country]>(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
})
}

Expand Down
4 changes: 2 additions & 2 deletions CountryPickerViewDemo/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PODS:
- CountryPickerView (3.0.8)
- CountryPickerView (3.1.0)

DEPENDENCIES:
- CountryPickerView (from `../`)
Expand All @@ -9,7 +9,7 @@ EXTERNAL SOURCES:
:path: "../"

SPEC CHECKSUMS:
CountryPickerView: d36c6fa3422671b1ba7c4d217e7367ca64de44e2
CountryPickerView: ab341e2253d5e1231ff679ec93441e413703cb9c

PODFILE CHECKSUM: 649829ad9a32abd953e33364dc48a4a40a615047

Expand Down

0 comments on commit e218980

Please sign in to comment.