Skip to content

xiujiekeman/MPVolumeObserverPro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MPVolumeObserverPro

use system notification to observe volume change
is optimize from MPVolumeObserver
this core can help user to monitor short press or long press , implement similar Snapchat take photo or take video.

Usage:

// start volume notification  
    [MPVolumeObserverPro sharedInstance].delegate = self;
[[MPVolumeObserverPro sharedInstance]startObserveVolumeChangeEvents];

// delegate
-(void) volumeButtonCameraClick:(MPVolumeObserver *) button
{
NSLog(@"+take Photo+");
   //you .........
}
-(void) volumeButtonStarVideoClick:(MPVolumeObserver *) button
{
NSLog(@"+start video+");
//you .........

}
-(void) volumeButtonEndVideoClick:(MPVolumeObserver *) button
{
NSLog(@"+end video+");
 //you .........

}

// end volume notification    
  [MPVolumeObserverPro sharedInstance].delegate = nil;
[[MPVolumeObserverPro sharedInstance]stopObserveVolumeChangeEvents];

About

MPVolumeObserver pro version

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published