jriosdev / iOSDropDown

Drop Down Menu for iOS With Search And Other Awesome Customisation
https://cocoapods.org/pods/iOSDropDown
MIT License
667 stars 150 forks source link

Pre selected value #75

Closed Muhitun closed 2 years ago

Muhitun commented 4 years ago

Hello, in the description of the library it is written that selectedIndex can be used to set value. But it is not accessible. It shows selectedindex setter is inaccessible. Can you please help me with this issue as I need to set a value returned from api in the search box.

reefwing commented 4 years ago

A work around for this issue is to set the text box directly and then the selected index (which does work for the check mark). For example:

dropDown.text = "Selected Text"
dropDown.selectedIndex = 0
Muhitun commented 4 years ago

Thanks for the help but still didn't work. I wrote the two lines you mentioned in the return function of my api call and still shows Cannot assign to property: 'selectedIndex' setter is inaccessible

jriosdev commented 2 years ago

: 'selectedIndex' setter is now accessible