title: How to implement a volume key shutter for iPhone?
body: <p>I want to implement the same behavior with the native camera of <code>iOS5</code>:</p>
  
  <ul>
  <li>press the volume + button to take a photo</li>
  </ul>
  
  <p><strong>What's the ideal way to archive it? 
  Are there any ways to capture the volume key pressed event?</strong></p>
  
  <p>After googling &amp; searching around for hours, I found 1 solution: using <code>NSNotificationCenter</code>: </p>
  
  <pre><code>...
      [[NSNotificationCenter defaultCenter]
           addObserver:self
           selector:@selector(volumeChanged:)
           name:@"AVSystemController_SystemVolumeDidChangeNotification"
           object:nil];
  ...
  - (void)volumeChanged:(NSNotification *)notification{
      [self takePhoto];   
  }
  </code></pre>
  
  <p>However, it has 2 issues:</p>
  
  <ul>
  <li>There is an semi-transparent overlay of "current system volume" show up every time when pressing the volume key, this is not what I wanted. </li>
  <li>For the native camera, when you press the volume key as shutter, the system volume won't change, however, by using the above method, the system volume will change.</li>
  </ul>