title: UIPickerView best practice?
body: <p>One short question: on a registration process I would like to ask the user to choose a value from a list of values.</p>
  
  <p>Is it the right way to use a view Controller adding there all text fields and for the values a picker view? As the picker view needs so much space in between the text fields area I wonder what the best practice in this case would be? </p>
  
  <p>this is my code so far:</p>
  
  <pre><code>class RegisterViewController: UIViewController, UIPickerViewDelegate, UIPickerViewDataSource{
  
  @IBOutlet weak var gradeTextField: UITextField!
  @IBOutlet weak var gradePicker: UIPickerView!
  
  let gradePickerValues = ["5. Klasse", "6. Klasse", "7. Klasse"]
  
  func numberOfComponentsInPickerView(pickerView: UIPickerView!) -&gt; Int{
      return 1
  }
  func pickerView(pickerView: UIPickerView, numberOfRowsInComponent component: Int) -&gt; Int{
      return gradePickerValues.count
  }
  func pickerView(pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -&gt; String! {
      return gradePickerValues[row]
  }
  func pickerView(pickerView: UIPickerView!, didSelectRow row: Int, inComponent component: Int){
      gradeTextField.text = gradePickerValues[row]
      self.view.endEditing(true)
  }
  
  override func viewDidLoad() {
      super.viewDidLoad()
  
      statusMessageLabel.hidden = true
  
      gradePicker.dataSource = self
      gradePicker.delegate = self
      gradePicker.hidden = true
  
      gradeTextField.inputView = UIPickerView()
      gradeTextField.text = gradePickerValues[0]
  
  }
  </code></pre>
  
  <p>The pickerview is hidden at the beginning and appears only when I select the text field, this is fine so far... But the the picker view is empty...</p>
  
  <p><img src="https://i.stack.imgur.com/RWP0H.png" alt="controller view with open picker view"></p>