You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since with iOS, I can only get the Locale region, I thought it would be better to have a initializer in Country struct to set this default value.
publicinit(regionCode:String){self.isoCode = regionCode
if let country =CountryManager.shared.getCountries().first(where:{ $0.isoCode == regionCode }){self.phoneCode = country.phoneCode
}else{self.phoneCode =""}}
This way I can set @State private var country = Country(regionCode: Locale.current.regionCode ?? "TR")
@Rashidium What I meant was the set a default selected country for the picker.
Right now, I have set
selectedCountry
to TR which sets a green background in the picker view but this is not enough to pre-select the value.Simulator.Screen.Recording.-.iPhone.11.Pro.Max.-.2021-12-26.at.13.33.06.mp4
Since with iOS, I can only get the Locale region, I thought it would be better to have a initializer in Country struct to set this default value.
This way I can set
@State private var country = Country(regionCode: Locale.current.regionCode ?? "TR")
Originally posted by @hcancelik in #6 (comment)
The text was updated successfully, but these errors were encountered: