Open nivbp7 opened 6 years ago
Hi, I'm trying to use the code, but can't seem to get it to run.
Hi,
This is the code:
`
@interface ViewController ()
@property (nonatomic,strong) JPSVolumeButtonHandler *volumeButtonHandler;
@end
@implementation ViewController
-(void)viewWillAppear:(BOOL)animated{ [super viewWillAppear:animated]; [self.volumeButtonHandler stopHandler]; [self.volumeButtonHandler startHandler:YES]; [NSTimer scheduledTimerWithTimeInterval:2.0 target:self selector:@selector(takePhoto) userInfo:nil repeats:NO];
}
-(void)takePhoto{ NSLog(@"takePhoto"); self.volumeButtonHandler = [JPSVolumeButtonHandler volumeButtonHandlerWithUpBlock:^{ // Volume Up Button Pressed NSLog(@"Volume Up Button Pressed");
} downBlock:^{ // Volume Down Button Pressed NSLog(@"Volume Down Button Pressed"); }];
} @end `
Hi,
I'm trying to use the code, but can't seem to get it to run.This is the code:
`
import "ViewController.h"
import "JPSVolumeButtonHandler.h"
@interface ViewController ()
@property (nonatomic,strong) JPSVolumeButtonHandler *volumeButtonHandler;
@end
@implementation ViewController
-(void)viewWillAppear:(BOOL)animated{ [super viewWillAppear:animated]; [self.volumeButtonHandler stopHandler]; [self.volumeButtonHandler startHandler:YES]; [NSTimer scheduledTimerWithTimeInterval:2.0 target:self selector:@selector(takePhoto) userInfo:nil repeats:NO];
}
-(void)takePhoto{ NSLog(@"takePhoto"); self.volumeButtonHandler = [JPSVolumeButtonHandler volumeButtonHandlerWithUpBlock:^{ // Volume Up Button Pressed NSLog(@"Volume Up Button Pressed");
} @end `