diff --git a/CountryPickerView/CountryPickerView.swift b/CountryPickerView/CountryPickerView.swift index c22e614..f811e6d 100644 --- a/CountryPickerView/CountryPickerView.swift +++ b/CountryPickerView/CountryPickerView.swift @@ -105,6 +105,7 @@ public class CountryPickerView: NibView { } set { _selectedCountry = newValue + delegate?.countryPickerView(self, didSelectCountry: newValue) setup() } } @@ -202,7 +203,7 @@ public class CountryPickerView: NibView { //MARK: Helper methods extension CountryPickerView { public func setCountryByName(_ name: String) { - if let country = countries.first(where: { $0.name == name }){ + if let country = countries.first(where: { $0.name == name }) { selectedCountry = country } } diff --git a/CountryPickerView/CountryPickerViewController.swift b/CountryPickerView/CountryPickerViewController.swift index 1a6a519..e2b7166 100644 --- a/CountryPickerView/CountryPickerViewController.swift +++ b/CountryPickerView/CountryPickerViewController.swift @@ -197,7 +197,6 @@ extension CountryPickerViewController { let completion = { self.countryPickerView.selectedCountry = country - self.countryPickerView.delegate?.countryPickerView(self.countryPickerView, didSelectCountry: country) } // If this is root, dismiss, else pop if navigationController?.viewControllers.count == 1 {