xcode is showing error compiling the codes : <p>Here:-</p>

<p>import UIKit</p>

<p>class ViewController : UIViewController,UIPickerViewDataSource,UIPickerViewDelegate {
    @IBOutlet weak var statePicker: UIPickerView!</p>

<pre><code>@IBOutlet weak var statepickerbtn: UIButton!

let states = ["alaska","alabama","akansas","california","maine","new york"]

override func viewDidLoad() {
    super.viewDidLoad()
    statePicker.dataSource = self
    statePicker.delegate = self
    // Do any additional setup after loading the view, typically from a nib.
}

override func didReceiveMemoryWarning() {
    super.didReceiveMemoryWarning()
    // Dispose of any resources that can be recreated.
}

@IBAction func statebtnpressed(_ sender: Any) {

    func numberOfComponents(in: &lt;#T##UIPickerView#&gt;)-&gt; Int
    {
        return 1
    }
    func pickerView(&lt;#T##pickerView: UIPickerView##UIPickerView#&gt;, numberOfRowsInComponent: &lt;#T##Int#&gt;)-&gt;Int
    {
        return states.count
    }


    func pickerView(&lt;#T##pickerView: UIPickerView##UIPickerView#&gt;, titleForRow: &lt;#T##Int#&gt;, forComponent: &lt;#T##Int#&gt;) -&gt; String?
    {
        return states[row]
    }

}
</code></pre>

<p>}</p>
