title: iOS Swift - segue to a class - passing Int value from a ViewController to a Class using prepareForSegue
body: <p>I am trying to push value of variable cellNumber located in ViewOne (ViewController) to variable trackNumber located at RadioPlayer (class RadioPlayer) buy using below code in ViewOne:</p>
  
  <pre><code>override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
      //var DestViewControler : ViewController = segue.destinationViewController as! ViewController
      var Dest2ViewControler : RadioPlayer = segue.destinationViewController as! RadioPlayer
  
     // DestViewControler.trackNumber = cellNumber
      Dest2ViewControler.trackNumber = cellNumber
  }
  </code></pre>
  
  <p>but I am getting bellow error when running the app:</p>
  
  <pre><code> Could not cast value of type 'The_Radio_App.ViewController' (0x73e48) to 'The_Radio_App.RadioPlayer' (0x745a8).
  </code></pre>
  
  <p>and this line of code is highlighted in green:
      var Dest2ViewControler : RadioPlayer = segue.destinationViewController as! RadioPlayer</p>
  
  <p>So I think what is causing a problem here is this: segue.destinationViewController - because RadioPlayer is not a ViewController but just a class. How can I amend this to make this work? </p>