         break
     }
   }
+  
+  deinit {
+    UIApplication.sharedApplication().endReceivingRemoteControlEvents();
+  }
 }
        println("play/pause toggled")
      case .RemoteControlPlay:
        println("play button pressed")
        audioManager.play();
      case .RemoteControlPause:
        println("pause button pressed")
        audioManager.pause();


class RootViewController: UIViewController {

  let audioManager: AudioManager = AudioManager()
  
  override func canBecomeFirstResponder() -> Bool {
    return true
