1

I am doing an app which take pictures and uploads to server. I am using custom camera overlay, I am showing it using

[self presentModalViewController:self.picker animated:NO];

I want to capture picture on pressing volume key up also. I tried this code but no benefit

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(takePicture:)name:@"AVSystemController_SystemVolumeDidChangeNotification" object:nil];

Kindly help me. Thanks in advance.

Nuraiz
  • 1,060
  • 6
  • 17
  • 35

1 Answers1

1

There is a drop in library that you can use found on Github here: https://github.com/blladnar/RBVolumeButtons

If you want to roll your own see the accepted answer here (where I got the previous link): Detect iPhone Volume Button Up Press?

Community
  • 1
  • 1
mwright
  • 4,099
  • 7
  • 30
  • 40