Search code examples
iosswiftuipickerview

UIPickerView stopped spinning - Swift


I need to make an app that runs a certain code when the UIPickerView stopped spinning. Is there a way to check if the picker view stopped spinning? Thanks.


Solution

  • Using didSelectRow is the way to check if the user did selected a row.

    However, this method is fired only when the picker "stop spinning".

        func pickerView(pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) {
        // Here you run your code.
    }
    

    Hope that helps.