I am trying to implement the SwiftUI version of the UIKit Country Picker.
User enter a form where there is a Picker object which should creates the Picker with all the countries along with the country flag image.
See the screen shots below:
First screen is the form when you first attempt to add a Review
User clicks the Country of Origin picker object and it navigates to the Countries view. ** This is where the issue is, images wont render!? **
The user selects a country and it closes the picker view to return back to the form view and it displays the selection, which works perfectly, displays both the image and the name of the country selected.
Has anyone been able to figure out if a solution to this, or is this a bug with iOS 13!?
The code is as follows:
Form {
TextField("Name", text: $name)
TextField("Description", text: $desc)
Picker(selection: $countryOrigin, label: Text("Country of Origin")) {
Section(header: SearchBar(text: $fetcher.searchQuery)) {
List(fetcher.country) { country in
HStack() {
Image(uiImage: UIImage(contentsOfFile: Bundle.main.path(forResource: "CountryPicker", ofType: "bundle")! + "/Images/\(country.id).png")!)
.clipShape(Circle())
Text(country.name)
}
}
}
}
}





