This commit is contained in:
Lochlan Wansbrough 2015-10-10 15:23:27 -07:00
parent a6f068be1f
commit 8cc61edef2
3 changed files with 7 additions and 2 deletions

View File

@ -59,6 +59,7 @@ typedef NS_ENUM(NSInteger, RCTCameraTorchMode) {
@property (nonatomic) AVCaptureVideoPreviewLayer *previewLayer;
@property (nonatomic) NSInteger videoTarget;
@property (nonatomic, strong) RCTResponseSenderBlock videoCallback;
@property (nonatomic, strong) RCTCamera *camera;
- (void)changeAspect:(NSString *)aspect;

View File

@ -16,7 +16,11 @@ RCT_EXPORT_MODULE();
- (UIView *)view
{
return [[RCTCamera alloc] initWithManager:self bridge:self.bridge];
if(!self.camera){
self.camera = [[RCTCamera alloc] initWithManager:self bridge:self.bridge];
return self.camera;
}
return self.camera;
}
RCT_EXPORT_VIEW_PROPERTY(aspect, NSInteger);

View File

@ -4,7 +4,7 @@
"type" : "git",
"url" : "https://github.com/lwansbrough/react-native-camera.git"
},
"version": "0.3.6",
"version": "0.3.7",
"description": "A Camera component for React Native. Also reads barcodes.",
"author": "Lochlan Wansbrough <lochie@live.com> (http://lwansbrough.com)",
"nativePackage": true,