【发布时间】:2014-10-31 12:09:50
【问题描述】:
如何在 Swift 中获取 UIPickerViewControl 的选定值?
我尝试过这样的事情:
labelTest.text = Spinner1.selectedRowInComponent(0).description
但这只会返回选定的索引。我需要价值。
谁知道怎么做?
【问题讨论】:
-
让 selectedValue = rolePicker.selectedRowInComponent(0) 给我一个值。另外, let selectedValue = rolePicker.selectedRowInComponent(0).hashValue 也可能给你一些用处。