Post

Replies

Boosts

Views

Activity

Reply to How to set the first object in the array as default selected in Country Picker
//Countries var countries: [Country] = CountryLanguageManager.shared().getAllCountriesToDisplay() // Function that gets entries for picker view func getEntries() -> [String] {         countries =  countries.sorted {             ExampleLocalizedString.getLocalizedString($0.CountryStringID) <                ExampleLocalizedString.getLocalizedString($1.CountryStringID) }         let countryCodes = countries.map{$0.isoCode}         return countryCodes     } // Function that gets initially selected func getInitiallySelectedEntry() -> String {         if let safeCode = initialcode {             return safeCode         } else {             return self.countries[0].isoCode         }     } // Setting up OK Button func setupOkButton() {         let action = VWConnectUIAlertAction(title: ExampleLocalizedString.getLocalizedString("OK"),                                             style: UIAlertActionStyle.default,                                             accesibilityID: AccessibilityIdConstants.onBoarding_country_picker_ok) { (_) in             self.onOkClicked()         }         self.addAction(action)     }
Topic: Programming Languages SubTopic: Swift Tags:
Jul ’22