iOSDropDown
iOSDropDown copied to clipboard
How to programatically set preselected Index?
This is my code,
dropDown.selectedIndex = selectIndexAt
But didn't works
Just saw this and running into the same issue I did this to solve it:
dropDown.selectedIndex = 0
dropDown.text = dropDown.optionArray[dropDown.selectedIndex!]
The actual index does get selected with "selectedIndex" but it does not display the text in the field, this way you also get the text placed in the field.
Hope this helps.