Closed dardoc-Tech closed 2 years ago
struct CountryPicker : UIViewControllerRepresentable{
typealias UIViewControllerType = CountryPickerViewController
let countryPicker = CountryPickerViewController() func makeUIViewController(context: Context) -> CountryPickerViewController {
countryPicker.selectedCountry = "TR" return countryPicker
}
func updateUIViewController(_ uiViewController: CountryPickerViewController, context: Context) {
} func makeCoordinator() -> Coordinator { return Coordinator(countryPicker) }
class Coordinator : NSObject , CountryPickerDelegate{
init(_ parent : CountryPickerViewController) { super.init() parent.delegate = self } func countryPicker(didSelect country: Country) { print(country) }
} }
struct CountryPicker : UIViewControllerRepresentable{
typealias UIViewControllerType = CountryPickerViewController
let countryPicker = CountryPickerViewController() func makeUIViewController(context: Context) -> CountryPickerViewController {
}
func updateUIViewController(_ uiViewController: CountryPickerViewController, context: Context) {
} func makeCoordinator() -> Coordinator { return Coordinator(countryPicker) }
class Coordinator : NSObject , CountryPickerDelegate{
} }