M
M
Maxim2018-11-23 12:00:51
iOS
Maxim, 2018-11-23 12:00:51

Why is the array not being passed to Picker?

Why is the array not being passed to picker?
5bf7c17594466108533685.png

// Array of values in picker
    let numeralSystems = ["16 NS","10 NS", "8 NS", "2 NS" ]
    
    func numberOfComponents(in pickerView: UIPickerView) -> Int {
        return 1
    }
    
    func pickerView(_ pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String? {
        return numeralSystems[row]
    }
    
    func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int {
        return numeralSystems.count
    }
    
    func pickerView(_ pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) {
        fromLabel.text = numeralSystems[row]
    }

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question