title: UIPickerView items from segue are not loaded
body: <p>I am trying to load items into UIPickerView, these items are loaded from a list that is populated in a prepareforsegue function in a previous view</p>
  
  <pre><code>class AddItemViewController: UIViewController, UIPickerViewDataSource, UIPickerViewDelegate {
  
  
      @IBOutlet weak var ItemPickView: UIPickerView!
      @IBOutlet weak var textboxName: UITextField!
  
      var options: [String]?
      var name: String?
  
      override func viewDidLoad() {
          super.viewDidLoad()
          print("viewdidload started")
          ItemPickView.delegate = self
          ItemPickView.dataSource = self
          textboxName.inputView = ItemPickView
          print("viewdidload ended")
          print(options)
      }
  
      func numberOfComponentsInPickerView(pickerView: UIPickerView) -&gt; Int {
          return 1
      }
  
      func pickerView(pickerView: UIPickerView, numberOfRowsInComponent component: Int) -&gt; Int {
          options!.count
      }
  
      func pickerView(pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -&gt; String? {
          return options![row]
      }
  
      func pickerView(pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) {
          textboxName.text = options![row]
      }
  }
  </code></pre>
  
  <p>My segue code</p>
  
  <pre><code> override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
  
      if segue.identifier == "AddNewItem" {
          print("segue started")
          let controller = segue.destinationViewController as? AddItemViewController
          controller?.options = ["test1","test2","test3"]
          print("segue ended")
      }
   }
  </code></pre>
  
  <p>It seems that the UIPickerView is initiated before the list is changed. Any workaround for this?</p>
  
  <p>Thanks a lot</p>
  
  <p>Edit: here is the log from print statments</p>
  
  <pre><code>segue started
  segue ended
  viewdidload started
  viewdidload ended
  nil
  fatal error: unexpectedly found nil while unwrapping an Optional value
  (lldb) 
  </code></pre>
  
  <p>It seems segue finishes before viewdidload.. then why isn't options list updated?</p>