Skip to content

Commit

Permalink
fix_didselectedrow (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
longvt96 authored and kmcgill88 committed Apr 9, 2019
1 parent e6f8dc8 commit 474d6f4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions McPicker/Classes/McPicker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -439,8 +439,10 @@ extension McPicker : UIPickerViewDelegate {
}

public func pickerView(_ pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) {
self.pickerSelection[component] = pickerData[component][row]
self.selectionChangedHandler?(self.pickerSelection, component)
if component < pickerSelection.count {
self.pickerSelection[component] = pickerData[component][row]
self.selectionChangedHandler?(self.pickerSelection, component)
}
}
}

Expand Down

0 comments on commit 474d6f4

Please sign in to comment.