我的数据库结构
我遇到了从firebase到UIPickerView显示数据列表的问题。
我想将其设置为选项 像firebase中的数据列表应该是我的UIPickerview选项:
import UIKit
import FirebaseDatabase
import Firebase
var vehicalList = [String]()
class CausticSodaEntryVC: UIViewController, UIPickerViewDelegate,
UIPickerViewDataSource {
@IBOutlet weak var causticVehical: UIPickerView!
func numberOfComponents(in pickerView: UIPickerView) -> Int
{
return vehicalList.count
}
func pickerView(_ pickerView: UIPickerView, titleForRow row: Int,
forComponent component: Int) -> String?
{
return vehicalList[row]
}
func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent
component: Int) -> Int
{
return vehicalList.count
}
func pickerView(_ pickerView: UIPickerView, didSelectRow row: Int,
inComponent component: Int)
{
print(" ")
}