title: How do I use a dictionary to populate a picker view (swift)?
body: <p>When using a dictionary to populate a UIPickerView in Swift, how do I specify that the key is to be used as the title for row, while the value is used to perform calculations, such as to set the value for selectedPower, below? </p>
  
  <p>If I were using an array of floats, I'd set it up as below, but how do I do it with a dictionary? </p>
  
  <pre><code>class DiagnosticORViewController: UIViewController, UIPickerViewDataSource, UIPickerViewDelegate {
  
  var selectedPower : Float!
  
  let FitAssessment : [String : Float] = ["0.50 flat" : -0.50, "0.25 flat" : -0.25, "aligned" : 0, "0.25 steep" : 0.25, "0.50 steep" : 0.50]
  
  func numberOfComponentsInPickerView(pickerView: UIPickerView) -&gt; Int {
  
      return 1    
  }
  
  func pickerView(pickerView: UIPickerView, numberOfRowsInComponent component: Int) -&gt; Int {
  
      return FitAssessment.count   
  }
  
  func pickerView(pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -&gt; String! {
  
      return "\(FitAssessment[row])"
  }
  
  func pickerView(pickerView: UIPickerView!, didSelectRow row: Int, inComponent component: Int) {
  
      selectedPower = FitAssessment[row]   
  }
  </code></pre>