I have a PickerView in which I choose the gender, male or female
enter image description here

I call in db by api and i need to pass the value 1 or 0
How to make it so that when I choose the male gender, the key is created in pickerview 1
Is there such an opportunity for this component?

    1 answer 1

    UIPickerView has a delegate method that scrolls data of the selected cell.

     func pickerView(_ pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) { if row == 0 { print("мужской") } else if row == 1 { print("женский") } } 
    • Thanks a lot - Marshall