diff --git a/JNPhoneNumberView.podspec b/JNPhoneNumberView.podspec index 502c8b2..82abbfb 100644 --- a/JNPhoneNumberView.podspec +++ b/JNPhoneNumberView.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "JNPhoneNumberView" - s.version = "1.0.14" + s.version = "1.0.15" s.summary = "Phone Number Validation with country dial code picker" s.description = "A view to show the country dial code and the phone number, you can click on the dial code and select another country from the countries picker, this view has a delegate methods to pass the international number and validity of it." s.homepage = "https://github.com/JNDisrupter" diff --git a/JNPhoneNumberView/Classes/JNPhoneNumberView.swift b/JNPhoneNumberView/Classes/JNPhoneNumberView.swift index 98a8177..4673f76 100644 --- a/JNPhoneNumberView/Classes/JNPhoneNumberView.swift +++ b/JNPhoneNumberView/Classes/JNPhoneNumberView.swift @@ -117,7 +117,9 @@ public class JNPhoneNumberView: UIView, UITextFieldDelegate { } // Set selected country - self.selectedCountry = JNCountryUtil.generateDialCode(for: defaultCountryCode) + if let country = JNCountryUtil.generateDialCode(for: defaultCountryCode) { + self.selectedCountry = country + } // Setup country code button self.setupCountyLabels()