Swift: UIPickerview 选择 row-id / Index

Swift: UIPickerview selecting row-id / Index

我试图从选择器视图中获取选定的行 ID/索引, 但我只得到所选行的名称。

我在网络和文档上搜索都没有结果。

如何获取所选行的 ID? 谢谢

使用 selectedRowInComponent(_:

我引用UIPickerView Class reference:

Returns the index of the selected row in a given component.