Skip to content

Commit

Permalink
repair bug
Browse files Browse the repository at this point in the history
  • Loading branch information
shabake committed Apr 9, 2019
1 parent 2fdf4ef commit 0dd8718
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
5 changes: 4 additions & 1 deletion GHCameraModule/GHCameraModule.m
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,13 @@ - (void)takePhoto {

- (void)adjustFocalWtihValue: (CGFloat)value {

AVCaptureConnection * videoConnection = [self.stillImageOutput connectionWithMediaType:AVMediaTypeVideo];
AVCaptureConnection *videoConnection = [self.stillImageOutput connectionWithMediaType:AVMediaTypeVideo];

[self.previewLayer setAffineTransform:CGAffineTransformMakeScale(1+value, 1+value)];
[self.input.device lockForConfiguration:nil];
videoConnection.videoScaleAndCropFactor = 1 + value;
[self.input.device unlockForConfiguration];

}

- (void)turnTorchOn:(BOOL)on{
Expand Down
4 changes: 3 additions & 1 deletion GHCustom/GHCameraModuleViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,9 @@ - (void)cameraModuleView:(GHCameraModuleView *)cameraModuleView button:(UIButton
}

- (void)cameraModule:(GHCameraModule *)cameraModule info:(NSDictionary *)info resultString:(NSString *)resultString {


UIAlertView *alertView = [[UIAlertView alloc]initWithTitle:@"扫描结果" message:resultString delegate:nil cancelButtonTitle:@"知道了" otherButtonTitles:nil, nil];
[alertView show];
}

#pragma mark - 懒加载
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ - (void)viewDidLoad {

self.mapView = [[BMKMapView alloc]initWithFrame:self.view.bounds];
self.mapView.delegate = self;
self.mapView.showsUserLocation = YES;

[self.view addSubview:self.mapView];

self.view.backgroundColor = [UIColor orangeColor];
Expand Down

0 comments on commit 0dd8718

Please sign in to comment.