title: Picker Views and if statements
body: <p>I have created a successful pickerview using this tutorial:</p>
  
  <p><a href="https://www.youtube.com/watch?v=oHkEUibsShM" rel="nofollow">Link to tutorial</a></p>
  
  <p>I want to be able to do something different when each option is selected whereas most tutorials just show how to do one thing for all options e.g. putting the option text into a label.</p>
  
  <p>This is the code I have attempting to do what I want. (I put in the print part to see if the code was being run and it wasn't.)</p>
  
  <pre><code>func pickerView(pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) {
          if row == 0 {
              currentSpeedMeasurement = "MPH"
              speed = speed * 2.23694
              print("Testing")
          }else if row == 1 {
              currentSpeedMeasurement = "KPH"
              speed = speed * 3.6
          } else if row == 2 {
              currentSpeedMeasurement = "M/S"
              speed = locationManager.location!.speed
              //speed = round(100 * speed)
          }
      }
  </code></pre>
  
  <p>Edit: Below is all of my code for the project. I am creating an app that shows the speed the person is travelling at. 
  I want the user to pick a speed measurement from the PickerView (named measurementPicker) e.g. MPH.</p>
  
  <p>I want the switch to activate depending on what option the user selects using the switch statement. </p>
  
  <p>I want the speed to then be displayed in a label (having been converted to the desired measurement) with the measurement afterwards. E.G. "Your speed: 10 MPH"</p>
  
  <p>The switch doesn't seem to be running because the measurement is always m/s.</p>
  
  <p>Please help!</p>
  
  <p>Thanks</p>