TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Sep 2017 |
Maintained by JP Simard.
JPSVolumeButtonHandler
provides an easy block interface to hardware volume buttons on iOS devices. Perfect for camera apps! Used in JPSImagePickerController
.
Features:
Drag the JPSVolumeButtonHandler
folder into your project and link the MediaPlayer and AVFoundation frameworks to your project.
Set your blocks to be run when the volume buttons are pressed:
self.volumeButtonHandler = [JPSVolumeButtonHandler volumeButtonHandlerWithUpBlock:^{
// Volume Up Button Pressed
} downBlock:^{
// Volume Down Button Pressed
}];
To enbable/disable the handler:
// Start
[self.volumeButtonHandler startHandler:YES];
// Stop
[self.volumeButtonHandler stopHandler];
To change audio session category (by default AVAudioSessionCategoryPlayAndRecord):
// Set category
self.volumeButtonHandler.sessionCategory = AVAudioSessionCategoryAmbient;
This project is under the MIT license.