如何在iOS上为SBPickerSelector设置默认值(不是日期)

时间:2018-04-04 21:13:00

标签: ios swift

对于iOS上的此选择器库Busta117/SBPickerSelector,如何为.text种类numberOfComponents = 2设置默认值?

我目前正在展示它:

let picker = SBPickerSelector()
picker.delegate = self
picker.numberOfComponents = 2
picker.pickerType = .text
picker.pickerData = [["3", "4", "5", "6", "7", "8", "9", "10"],
                     Array(repeating: "", count: 13).enumerated().map{"\($0.0) in"}]

picker.pickerId = "height"
picker.doneButtonTitle = "Done"
picker.cancelButtonTitle = "Cancel"

picker.showPickerOver(self)

1 个答案:

答案 0 :(得分:0)

picker.pickerView包含UIPickerView,您可以:

picker.pickerView.selectRow(<row: Int>, inComponent: Int>, animated: Bool)