1

In an app I'm currently working on I'm using an instance of UIImagePickerController with a custom overlay. Everything works great, but now I'm try to figure out if there's a way to use the physical camera button to take pictures while using my instance of UIImagePickerController.

I believe that the physical camera button is new on iPhone 4 (or is it 4s?) and that this button does double-duty as the volume up button. For some reason, this button does not work with my custom instance of UIImagePickerController.

Does anyone know if it's possible to get it working again?

Thanks!

Rich Everhart
  • 1,043
  • 4
  • 19
  • 29
  • The physical camera button is not a hardware feature, it's a software change to the camera app in iOS 5. It works on any iPhone. The camera+ app had it for years before Apple implemented it in their own camera. I'm not sure how you implement it, but I suspect it's basically just a matter of detecting the volume up event and hijacking that event to take a picture. I don't believe there's anything like a "use volume button for camera" flag that you can set on UIImagePickerController. – Nick Lockwood Jan 26 '12 at 02:46
  • @Nick-Lockwood, unfortunately the volume-up event is not detectable in the usual way while the UIImagePickerController is being shown. I have posted a similar question here, with some additional info: http://stackoverflow.com/questions/9109353/how-to-take-a-photo-on-the-volume-up-event-when-using-uiimagepickercontroller-wi – William Denniss Feb 02 '12 at 08:55
  • Fair enough. I've posted some suggestions in reply to your question. – Nick Lockwood Feb 02 '12 at 11:18

1 Answers1

0

Here's a tutorial on how to use the volume buttons for camera shutter:

http://ios.biomsoft.com/2011/12/07/taking-control-of-the-volume-buttons-on-ios-like-camera/

Nick Lockwood
  • 40,865
  • 11
  • 112
  • 103
  • 1
    That code doesn't appear to work when using custom overlay. Works perfectly in other situations, though. – joshholat May 03 '12 at 14:15