title: Detect volume button press
body: <p>Volume button notification function is not being called.</p>
  
  <p>Code:</p>
  
  <pre><code>func listenVolumeButton(){
      // Option #1
      NSNotificationCenter.defaultCenter().addObserver(self, selector: "volumeChanged:", name: "AVSystemController_SystemVolumeDidChangeNotification", object: nil)
      // Option #2
      var audioSession = AVAudioSession()
      audioSession.setActive(true, error: nil)
      audioSession.addObserver(self, forKeyPath: "volumeChanged", options: NSKeyValueObservingOptions.New, context: nil)
  }
  
  override func observeValueForKeyPath(keyPath: String, ofObject object: AnyObject, change: [NSObject : AnyObject], context: UnsafeMutablePointer&lt;Void&gt;) {
      if keyPath == "volumeChanged"{
          print("got in here")
      }
  }
  
  func volumeChanged(notification: NSNotification){
     print("got in here")
  }
  </code></pre>
  
  <p><code>listenVolumeButton()</code> is being called in viewWillAppear</p>
  
  <p>The code is not getting to the print statement <code>"got in here"</code>, in either case.</p>
  
  <p>I am trying two different ways to do it, neither way is working.</p>
  
  <p>I have followed this: <a href="https://stackoverflow.com/questions/9660445/detect-iphone-volume-button-up-press/22601280#22601280">Detect iPhone Volume Button Up Press?</a></p>